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

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -