neo Posted May 10, 2005 Report Share Posted May 10, 2005 Esmu izveidojis mekleetaaju kurš peec noteikta atsleegvaarda atrod kaut kaadu tekstu. Kaa izcelt sho atsleegvaardu atrastajaa tekstaa? Link to comment Share on other sites More sharing options...
Venom Posted May 10, 2005 Report Share Posted May 10, 2005 aizvietot ar to pašu vārdu iekš <b></b> tagiem Link to comment Share on other sites More sharing options...
рпр Posted May 10, 2005 Report Share Posted May 10, 2005 sitaam vajadziibaam manupraat ir vienkaarshi izmantot preg_replace fjas Link to comment Share on other sites More sharing options...
bubu Posted May 10, 2005 Report Share Posted May 10, 2005 Ja lapa ir HTMLiska, tad ar Javaskriptu, ja lapa PHPiska, tad ar PHP apmēram sekojošā veidā: padod urlim parametru: urlis?search=teksts+veel+teksts un kad izvadi dokumentu, tad meklē šo search parametru tekstā un izcel ar krāsu vai kā nu tev vajag. Link to comment Share on other sites More sharing options...
neo Posted May 12, 2005 Author Report Share Posted May 12, 2005 Taatad risinaajums vareetu buut shaads: <? $teksts="kaut kaads teksts ir šeit"; $mekleet="kaads"; $meklejamais = '/'.$mekleet.'/'; $aizvietojamais = "<b>".$mekleet."</b>"; $teksts= preg_replace($meklejamais, $aizvietojamais, $teksts); echo $teksts; ?> Link to comment Share on other sites More sharing options...
Venom Posted May 12, 2005 Report Share Posted May 12, 2005 $meklejamais = '/'.$mekleet.'/i'; lai aizvietotu arī kAads, Kaads, kaadS utt., bet aizvietojamais tad: $aizvietojamais = '<b>\\0</b>';, lai aizvietotu pret to pašu atrasto reģistru Link to comment Share on other sites More sharing options...
neo Posted May 12, 2005 Author Report Share Posted May 12, 2005 (edited) Paldies Venom tas bija tas kas vajadziigs, bet ir probleema ar garumziimeem un miikstinaajuemiem. Kaa panaakt lai atrod arii shos vardus? Edited May 12, 2005 by neo Link to comment Share on other sites More sharing options...
Venom Posted May 12, 2005 Report Share Posted May 12, 2005 a skatoties kāds kodējums ascii vai utf-8 Link to comment Share on other sites More sharing options...
neo Posted May 12, 2005 Author Report Share Posted May 12, 2005 abiem diviem Link to comment Share on other sites More sharing options...
neo Posted May 12, 2005 Author Report Share Posted May 12, 2005 bet vairaak laikam utf-8 Link to comment Share on other sites More sharing options...
Venom Posted May 12, 2005 Report Share Posted May 12, 2005 iesākumam der pamēģināt //u Link to comment Share on other sites More sharing options...
neo Posted May 12, 2005 Author Report Share Posted May 12, 2005 Tu domaa: $meklejamais = '/'.$mekleet.'/u'; Link to comment Share on other sites More sharing options...
Venom Posted May 12, 2005 Report Share Posted May 12, 2005 /iu, agā Link to comment Share on other sites More sharing options...
neo Posted May 12, 2005 Author Report Share Posted May 12, 2005 neko neatrod Link to comment Share on other sites More sharing options...
Venom Posted May 12, 2005 Report Share Posted May 12, 2005 pamēģini uzlikt set_locale, vai mbstring extension ieslēgt, bet tas jau nestandarta Link to comment Share on other sites More sharing options...
Recommended Posts