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.enter image description here

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

Popular posts from this blog

python - Alternative to referencing variable before assignment -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -