Jump to content

help in finding string position


houssam_ballout
 Share

Recommended Posts

Hello,I need help with the following:I had a dynamic variable in this form:XXXX-Y-A-B (which is called ID) XXXX is always fixed (character)Y is also a single characterA is an integerB is an integer I am quering a database that had list of that IDs , and I need to know the value of A each time (A could be 1, 2, 3, 11, 200....)Any help?Thanks

Link to comment
Share on other sites

or, you could use explode. http://php.net/manua...ion.explode.php you can explode on the '-' and then you would have the value of 'A' as the third index (2) of the returned array.

Edited by thescientist
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...