Plz Help Me asap..


#1

Hello my name is Shantam and i need some help
[php]function Smiley($texttoreplace)
{
$smilies=array(
‘Php’=>“xyz”,
‘PHp’=>“xyz”,
‘PhP’=>“xyz”,
‘PHP’=>“xyz”,
‘php’=>“xyz”,
‘pHP’=>“xyz”,
‘phP’=>“xyz”,
‘pHp’=>“xyz”,
);

$texttoreplace=str_replace(array_keys($smilies), array_values($smilies), $texttoreplace);
return $texttoreplace;

}[/php]
I use this code to rename “php” in filename to prevent shells but i think it would take a lot of time if i do it for html,asp,wml :frowning:

isnt there any way to rename the words without writing each and every uppercase and lowercase letters
i just mean that i need a short code :’(


#2

Most people use preg_replace for this. Here is a link that might help. Note the posts after the description.
Normally, strings are scrapped of HTML, Javascript, PHP and special codes.
http://php.net/manual/en/function.preg-replace.php

Depending what you want from the string, you could just replace everything except letters, space and numbers. This can be done with remove special chars function…