Jump to content

help with string manipulation


Gmunky

Recommended Posts

If I have a string

 

$string = "SELECT * FROM TABLE WHERE AGE > 0 ORDER BY NAME";

 

how would I retrieve part of the string before 'ORDER';

 

i want this part 'SELECT * FROM TABLE WHERE AGE > 0'

 

if i use strstr($string,"ORDER"), this retrieves 'ORDER BY NAME'

 

is there an opposite function of strstr()?

Link to comment
https://forums.phpfreaks.com/topic/46891-help-with-string-manipulation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.