Page 1 of 1
selecting data from a string
Posted: Thu May 22, 2003 7:16 am
by ridwan
Is it possible within php to select data from a certain character to another character and display the info within that selection. I dont know if the substr function will be able to do this if so can some one direct me please?
thanks
Posted: Thu May 22, 2003 8:43 am
by ckuipers
Please clarify a bit more what it is you are trying to do...
an example
Posted: Thu May 22, 2003 9:30 am
by ridwan
say there is info that is in between slashes and I want to select that info and disregard the rest for example:
asdasdasdda/example/asdasdasdas
how do i extract 'example' out of the previous string ?
thanks
Posted: Thu May 22, 2003 12:24 pm
by liljester
thats kindof a poor example... there are sooo many ways you could do that.
i suggest reading up on String Functions at the php.net website.
thanks....
Posted: Fri May 23, 2003 2:09 am
by ridwan
well could you at least throw me a bone here, that's kinda what forums are for to help each other out I'm not askin for full blown code it's just the basic function i need i'll look up the rest
Re: thanks....
Posted: Fri May 23, 2003 2:18 am
by twigletmac
ridwan wrote:well could you at least throw me a bone here, that's kinda what forums are for to help each other out I'm not askin for full blown code it's just the basic function i need i'll look up the rest
The 'bone' is the manual:
http://www.php.net/manual/en/ref.strings.php
What you asked could be done in a number of ways, look at the string functions and see which one suits the specific task you are trying to do.
People here are more than happy to help out generally but you have to also help yourself sometimes - we can't tell you the specific function you need because we have no idea exactly what you are trying to do (yes you have given us a general idea but that's why you've got a general answer).
Please go look at the manual.
Mac