lazda144 Posted March 31, 2008 Report Share Posted March 31, 2008 Es gribēju izmantot šo smaidinu funkciju: function smailji($teksts) { $ko_aizvietot = array(); $ar_ko_aizvietot = array(); $smailju_array = array( array('tongue.png',":P"), array('xmas.png','(xmas)'), ); foreach($smailju_array as $smailis) { $ko_aizvietot[] = ' '.$smailis[1].' '; $ar_ko_aizvietot[] = " <img src='smailji/{$smailis[0]}' alt='{$smailis[1]}'/> "; } return str_replace($ko_aizvietot,$ar_ko_aizvietot,$teksts); } bet man smaidini raadaas ja es ievadu saadi: l :P l Smaidins paraadaas , ja tam no abaam puseem ir dubultaaa atstarpe! Kur ir kuuda?? Link to comment Share on other sites More sharing options...
bubu Posted March 31, 2008 Report Share Posted March 31, 2008 Kļūda atstarpēs, kuras pats ieliki. Izvāc atstarpes no aizvietojamā stringa. Link to comment Share on other sites More sharing options...
lazda144 Posted April 1, 2008 Author Report Share Posted April 1, 2008 kuraa vietaa? es nawaru saprast! izmeeginaaju visaadus veidu jau!! Link to comment Share on other sites More sharing options...
andrisp Posted April 1, 2008 Report Share Posted April 1, 2008 $ko_aizvietot[] = ' '.$smailis[1].' '; ? Link to comment Share on other sites More sharing options...
bubu Posted April 1, 2008 Report Share Posted April 1, 2008 andrisp: drīzāk jau $ar_ko_aizvietot[] = " <img... /> "; Link to comment Share on other sites More sharing options...
andrisp Posted April 1, 2008 Report Share Posted April 1, 2008 Es, godīgi sakot, tagad vispār nesapratu, kas viņam par problēmu. Sākumā man likās, ka viņš grib, lai smailiji repleisojas arī, ja tam nav atstarpju sānos, bet tagad nesaprotu. Link to comment Share on other sites More sharing options...
martins256 Posted April 1, 2008 Report Share Posted April 1, 2008 tā kas tas skripts ir mans, strādā uz man pc. 99% domāju, ka viņš dabū alt="", jo tas ir tāds pats kāds bildes nosaukums ;) Izņem arā to alt='{$smailis[1]}' un paskaties vai tur vēl rāda! Link to comment Share on other sites More sharing options...
lazda144 Posted April 1, 2008 Author Report Share Posted April 1, 2008 ja iznem alt='{$smailis[1]} tad neraada ne smaidinu ne :P Link to comment Share on other sites More sharing options...
andrisp Posted April 1, 2008 Report Share Posted April 1, 2008 Nu tad tev vienkārši ceļš nepareizs uz bildēm. Link to comment Share on other sites More sharing options...
kalabox Posted April 13, 2008 Report Share Posted April 13, 2008 rekur $ar_ko_aizvietot[] = " TE<img src='smailji/{$smailis[0]}' alt='{$smailis[1]}'/>TE "; luuk atstarpes... Link to comment Share on other sites More sharing options...
Recommended Posts