Return to Snippet

Revision: 18873
at October 11, 2009 10:11 by jnbn


Initial Code
$text = "Sample sentence from KomunitasWeb, regex has become popular in web programming. Now we learn regex. According to wikipedia, Regular expressions (abbreviated as regex or regexp, with plural forms regexes, regexps, or regexen) are written in a formal language that can be interpreted by a regular expression processor";

$text = preg_replace("/b(regex)b/i", '<span style="background:#5fc9f6">1</span>', $text);
echo $text;

Initial URL

                                

Initial Description

                                

Initial Title
Highligt a word

Initial Tags

                                

Initial Language
PHP