<?php$str = "my bird is funny and is a pipe is ispod";$keyword = "bird fun is";$keyword = implode('|',explode(' ',preg_quote($keyword)));var_dump($keyword);$str = preg_replace("/($keyword)/i","<b>$0</b>",$str);echo $str;
Standard input is empty
string(11) "bird|fun|is" my <b>bird</b> <b>is</b> <b>fun</b>ny and <b>is</b> a pipe <b>is</b> <b>is</b>pod
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!