string - PHP substr() function is not working as expected -
i removing first character of string , using substr(); function that.
example :
<?php $amount = '€300'; echo substr($amount ,1); ?>
this code doing work fine have bug. when display substr() function applied string display other symbol @ beginning of string. below image has output.
in above image can see displaying unwanted symbol. when apply substr() function again works successfull.
want know why function having symbol? symbol mean? why coming in output?
i managed solve problem using utf8_decode
, i.e.:
$amount = utf8_decode('€300'); echo substr($amount ,1); //300
Comments
Post a Comment