see search result like google


/ Published in: PHP
Save to your folder(s)

$search_string - переменная для поиска


Copy this code and paste it in your HTML
  1. preg_match("/(.{1,100})".$search_string."(.{1,100})/is", $body, $res);
  2. echo " ...".$res[1]."<font color=red><b>".$search_string."</b></font>".$res[2]."...";

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.