Pulling a substring out of the middle of a string
Posted: Thu Feb 18, 2010 2:55 pm
hey,
I'm trying to pull a substring out of this string I have created based off of my query...
What I want is to pull the three different variables and set them each to strings.
here's a photo of said string

I can get the first and the last portions by using the following:
$vn = substr($vehicle, 0, strpos($vehicle, '~'));
&
$vp = substr($vehicle, strpos($vehicle, '|'));
but not the middle variable...
any help would be most appreciated
Thanks,
I'm trying to pull a substring out of this string I have created based off of my query...
What I want is to pull the three different variables and set them each to strings.
here's a photo of said string

I can get the first and the last portions by using the following:
$vn = substr($vehicle, 0, strpos($vehicle, '~'));
&
$vp = substr($vehicle, strpos($vehicle, '|'));
but not the middle variable...
any help would be most appreciated
Thanks,