Originally posted by drag0n
dont quote variables, anything quoted will be printed as normal text
Not neccesarily. Single quotes inplies text. Double quotes allows parsing.
ie.
$blah = "blahblah";
echo $blah; //produces blahblah
echo "$blah"; //produces blahblah
echo '$blah'; //produces $blah
The noticable problem in your code is the use of quotes in your substr function. Quoting the whole thing tell the function to treat everything inside the quotes as one variable, so the commas are doing what they're supposed to.
$ltr=substr("$ime, 0, 2"); // won't work
$ltr=substr("$ime", 0, 2); // would work, but quotes aren't neccesary
$ltr=substr($ime, 0, 2); // optimal