Regular Expression Help Needed! Quite help I guess :/
Posted: Tue Oct 03, 2006 10:02 am
Hi,
preg_match("/.*$search.*/i",$text,$return);
echo $return[0];
But that returns the whole text, not just the line: This site is made possible in part by a generous equipment grant from Sun MicroSystems Inc.
I want to get the whole sentence where the search word is written in. Possible? Please help!
I have a $search that is now set to "site". I want it to preg_match return the whole line matching that search word.Resources which are restricted to use by University faculty, staff, and students only can be found at the Encoded Text Services website. This site is made possible in part by a generous equipment grant from Sun MicroSystems Inc.
preg_match("/.*$search.*/i",$text,$return);
echo $return[0];
But that returns the whole text, not just the line: This site is made possible in part by a generous equipment grant from Sun MicroSystems Inc.
I want to get the whole sentence where the search word is written in. Possible? Please help!