Home  >  Q&A  >  body text

Why are different results shown?

<?php

//Declare a variable $iphone whose value is a string phone

$iphone = 'Mobile phone';

//unset destroy Remove a variable unset($iphone);

var_dump($iphone);

?>

The result in the web page is displayed as string(6) "mobile phone"

The actual result of the operation is string(4) "mobile phone"

What is the reason for the extra two character length

SmallanSmallan2139 days ago1213

reply all(4)I'll reply

  • 杨云雷

    杨云雷2018-11-22 08:31:38

    The reason for the encoding format of utf-8 and GBK is 6 for UTF-8 and 4 for GBK

    reply
    0
  • Smallan

    Thanks

    Smallan · 2018-12-14 16:35:36
  • 藏色散人

    藏色散人2018-11-21 09:41:32

    What does actual operation mean?

    reply
    0
  • Smallan

    The environment built by phpstudy, PHP5.4

    Smallan · 2018-12-14 16:36:22
  • Cancelreply