alohatofu Posted April 22, 2007 Share Posted April 22, 2007 How can I write it so that it will grab anything that is before a certain word. Please reference Remedy ticket #297019Notice ID: Let's say I want anything from the word reference on to but not including anything after the word Notice Link to comment https://forums.phpfreaks.com/topic/48179-anything-before-a-certain-word/ Share on other sites More sharing options...
c4onastick Posted April 23, 2007 Share Posted April 23, 2007 preg_match('/(?<=reference).*?(?=Notice)/', $text, $match); Link to comment https://forums.phpfreaks.com/topic/48179-anything-before-a-certain-word/#findComment-235656 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.