PHP trim function removing last character -


i ran weird issue php trim function.

<?php $str = "new multan nagar"; $trimmedstr = trim($str, ' \t\n\r\0\x0b'); var_dump($trimmedstr);// output => string(15) "new multan naga"  $str = "new multan nagar"; $trimmedstr = trim($str, " \t\n\r\0\x0b"); var_dump($trimmedstr); // output => string(16) "new multan nagar" ?> 

second parameter value default value used trim function, difference 1 inside single quotes , other inside double quotes. can explain behavior?

php not recognise slash(/) characters when using single quotes. when wrapped in double quotes seen special characters.

so in case single quoted version removing tnrx0b characters.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -