houssam_ballout Posted February 8, 2012 Share Posted February 8, 2012 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 More sharing options...
Ingolme Posted February 8, 2012 Share Posted February 8, 2012 You could study regular expressions and then use PHP's preg_match() function Link to comment Share on other sites More sharing options...
thescientist Posted February 8, 2012 Share Posted February 8, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.