how can i extract a piece of a variable. i.e how do i make "dog" = "d" or make "elephant" = "e". i'm sorry for my poor explanation. i hope someone can help. thanks
Use the function substring
Or even simpler, if you want the same letter all the time. Strings are really arrays, so you can refer to the first letter like this:
$animal = "elephant"; $first_letter = $animal[0];
echo $first_letter;
Will print the letter "e"..