Search String Script

Search String Script is used to search a string for a particular pattern or substring.

Demo :



Type Text  Select Tag :  

Example :

Example 1: I <b> went </b> to coimbatore to <b>meet </b> my <a href="http://www.friend.com'>friend </a>.
Example 2: <font> I bought the new mobile.</font>

If you need to Search String Script code you will copy and use to your website.


<?php
$html = "I <b> went </b> to coimbatore to <b>meet </b> my <a href='http://www.friend.com">friend </a>";

echo ereg("<b>(.*)+</b>", $html) ? "Match" : "No match";
?>

When it comes to searching for matches within a string, PHP offers the ereg() and preg_match() functions, which are equivalent: both functions accept a regular expression and a string, and return true if the string contains one or more matches to the regular expression. Readers familiar with Perl will usually prefer the preg_ match() function, as it enables them to use Perl-compliant regular expressions and, in some cases, is faster than the ereg() function.

Free Download Script :

If you need Search String Script click and download from following link.

Download




Content