king999 Posted February 18, 2007 Report Share Posted February 18, 2007 Zinu, ka esmu visiem apnicis, bet darbs jaanodod jau 2dien, un tagad cenšos pielikt smailijus. Bet visulaiku met virsū šitādu erroru: Parse error: parse error, unexpected T_STRING in C:\wamp\www\skatit.php on line 14 Kods: http://paste.php.lv/5164 Link to comment Share on other sites More sharing options...
andrisp Posted February 18, 2007 Report Share Posted February 18, 2007 preg_replace("/:)/i", "<img src=\"smilies/smile1.gif\">", $row); vai arī (un šādi ir labāk) preg_replace("/:)/i", '<img src="smilies/smile1.gif">', $row); Un no "i" modifiera (case-insensitive) šajā gadijumā nav jēgas. Link to comment Share on other sites More sharing options...
king999 Posted February 18, 2007 Author Report Share Posted February 18, 2007 Mjā, tagad visu tekstu parāda, bet pie :) rādās Warning: preg_replace() [function.preg-replace]: Compilation failed: unmatched parentheses at offset 1 in C:\wamp\www\skatit.php on line 12 :) Warning: preg_replace() [function.preg-replace]: Compilation failed: unmatched parentheses at offset 1 in C:\wamp\www\skatit.php on line 12 Link to comment Share on other sites More sharing options...
andrisp Posted February 18, 2007 Report Share Posted February 18, 2007 (edited) Ā, un jā - ) ir jāeskeipo - \) Btw, tik vienkāršu darbību kādu tu veic, var darīt arī ar str_replace. http://www.google.lv/search?hl=lv&q=regular+expressions Pirmajos linkos ir atbildes uz visiem taviem jautājumiem. Edited February 18, 2007 by andrisp Link to comment Share on other sites More sharing options...
king999 Posted February 18, 2007 Author Report Share Posted February 18, 2007 Ty shon pietiks riit turpinaashu murgot :) Link to comment Share on other sites More sharing options...
bubu Posted February 18, 2007 Report Share Posted February 18, 2007 Un priekškam preg_replace? Kas vainas str_replace? Šaujam zvirbuļus ar lielgabalu? Link to comment Share on other sites More sharing options...
Paulinjsh Posted February 19, 2007 Report Share Posted February 19, 2007 bubu ar lielgabalu labāk var trāpīt :D Link to comment Share on other sites More sharing options...
v3rb0 Posted February 19, 2007 Report Share Posted February 19, 2007 neizskatās ka viņam tā trāpīšana ar lielgabalu sanāk. $smailinji=array( ':))'=> '<img src="smailinsh3.png" />', ':(('=> '<img src="smailinsh4.png" />', ':)'=> '<img src="smailinsh1.png" />', ':('=> '<img src="smailinsh2.png" />', ); echo str_replace ( array_keys($smailinji), array_values($smailinji), ':) un :(, un :)), un veel :((' ); + pievērs uzmanību smailiņu secībai, tb. vispirms garākos repleiso, tad īsakos nevis otrādi. Link to comment Share on other sites More sharing options...
king999 Posted February 19, 2007 Author Report Share Posted February 19, 2007 Liels paldies, ieviesāt ljoti lielu skaidriibu. :) Link to comment Share on other sites More sharing options...
Recommended Posts