How to convert text, symbol and numeric datat to string

Hi

I want to convert the data which contains text, symbol and numbers. I want to convert them to string.

for example $t = amp;2011-07-07

this data I am getting from url. I want to make it as a string.

Thanks

MD.Samiuddin

$t = amp;2011-07-07

This line wont work as is, because PHP doesnt know what ‘amp’ means.

$t = “amp;2011-07-07”;

Now PHP knows what that is - it’s a string. Or at least, it’s a potential string.

PHP is loosely typed for basic data types; so…


$t = "1";
$t++;
echo $t; //2

PHP took my string, 1, saw that i wanted to do a mathematical operation for it, implicitly converted it to an numerical value, added 1 to it, and then output it as a string again.