| Autor | Zpráva | ||
|---|---|---|---|
| KryVosa Profil |
<?php
function specialChars($text, $back)
{
if($back==true)
{
$rext=preg_replace("/'/", "#39;", $text);
$text=preg_replace("/\"/", "#22;", $text);
$text=preg_replace("/\`/", "#96;", $text);
$text=preg_replace("/(\\\\)/", "#92;", $text);
//$text=preg_replace("/\$/", "#36;", $text);
}
else
{
$arr=Array();
$arr["39"]="'";$arr["22"]="\"";$arr["96"]="`";$arr["92"]="\\";$arr["36"]="\$";
$text=preg_replace("/#(..);/", $arr["$1"] ,$text);
}
return $text;
}
?> |
||
| Davex Profil |
#2 · Zasláno: 9. 10. 2015, 22:31:01
Je tam překlep ve jménu proměnné. Kromě toho na jednoduché nahrazování nepotřebuješ regulární výrazy a stačí
str_replace().
|
||
|
Časová prodleva: 11 let
|
|||
0