$search = "Want"; Search for the keyword $content = "There is moments in life if you miss someone so much it you just want to pick them from your Drea MS and hug them for real! Dream What do you want to Dream;go where do you want to go;be what do you want to be,because are only one life and one chance To does all the things you want to do "; How to search for "want" before and after the paragraph 30 characters//words can not be split//content appears in multiple "want" only search the first
Reply to discussion (solution)
$search = "Want"; Search for the keyword $content = "There is moments in life if you miss someone so much it you just want to pick them from your Drea MS and hug them for real! Dream What do you want to Dream;go where do you want to go;be what do you want to be,because are only one life and one chance To does all the things want to do "; $search = Preg_quote ($search);p reg_match ("/\b.{1,30}{$search}.{ 1,30}\b/", $content, $m); Echo $m [0];
Someone so much, just want to pick them from your dreams