Autor Zpráva
Muty
Profil
Zdravim poradí mi někdo jak upravit toto aby mi to jelo. Hází mi to chyby

$MySQLrow[clanek] = str_replace("/$search/","<span class=search>"/$search/"</span>", $MySQLrow[clanek]);
Dik moc
joejoe
Profil *
function highlight($search, $input) {
$regex = sprintf("#(?!<.*?)(%s)(?![^<>]*?>)#si", preg_quote($search));
return preg_replace($regex, '<span class="search">\1</span>', $input);
}
joejoe
Profil *
str_replace("/$search/","<span class=search>"/\$search/"</span>", $MySQLrow[clanek]);

musis pridat znak'\' pred $ jinak se ti to v uvozovkach prevede na obsah promenne
Muty
Profil
str_replace("/$search/","<span class=search>"/\$search/"</span>", $MySQLrow[clanek]);

musis pridat znak'\' pred $ jinak se ti to v uvozovkach prevede na obsah promenne

Nefunguje .......

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /disk1/home/ic/mutyrs/www/read.php on line 55

Warning: Division by zero in /disk1/home/ic/mutyrs/www/read.php on line 55

Warning: Division by zero in /disk1/home/ic/mutyrs/www/read.php on line 55
Anonymní
Profil *
$MySQLrow[clanek] = str_replace($search,"<span class=search>".$search."</span>", $MySQLrow[clanek]);
Muty
Profil
$MySQLrow[clanek] = str_replace($search,"<span class=search>".$search."</span>", $MySQLrow[clanek]);

Už to jede. Dík všem
Toto téma je uzamčeno. Odpověď nelze zaslat.

0