if I have a variable like $<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>="cheese"; how do I return just the first letter of it?
ie I want it to echo "c" in this case
[SOLVED] HELP! First letter of a variable
Moderator: General Moderators
-
rapaddict_dot_com
- Forum Commoner
- Posts: 27
- Joined: Tue Mar 16, 2004 4:54 pm
Code: Select all
$somevar = 'cheese';
echo $somevar{0};-
rapaddict_dot_com
- Forum Commoner
- Posts: 27
- Joined: Tue Mar 16, 2004 4:54 pm