- strpos: documentation ( source)
- htmlentities: documentation ( source)
- preg_replace: documentation ( source)
<?php
$search = htmlentities("echo str(2); apple'\e");
if (strpos($search, 'apple') !== false){
echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "apple");
}
?>