[ PHP ] How do I select a word from a string?
#4

You can use split.
PHP код:
$testString "Lunoxx sold a car."//Set the string to a test.
$splitText explode(' '$testString); //Now the actual code to split it from spaces.

//Now use it.
echo $splitText[0]; //Will print "Lunoxx" 
Reply


Messages In This Thread
[ PHP ] How do I select a word from a string? - by Lunoxel - 08.10.2015, 16:40
AW: [ PHP ] How do I select a word from a string? - by Nero_3D - 08.10.2015, 18:06
Re: [ PHP ] How do I select a word from a string? - by Lunoxel - 08.10.2015, 18:32
Re: [ PHP ] How do I select a word from a string? - by Ahmad45123 - 08.10.2015, 18:54

Forum Jump:


Users browsing this thread: 1 Guest(s)