Get string data between characters
I want to get information between two characters using PHP.
For example, if I have the string:
I want to extract the characters between the first two * characters. Therefore, my variable will read "42".
How would I go about doing this?
Explode is your friend.
$string = "Tralala*42*lalala*wee*morewords";
$array = explode("*",$string);
echo $array; //Tralala
echo $array; //42
Then explode I shall use.
I thank you for your time.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread