dAivEd Posted October 2, 2010 Report Share Posted October 2, 2010 (edited) Labidien! Taatad man ir teksts: ir mainigais piem.: $text = "Chaw mani sauc Edgars"; vajag iznemt vardu "Edgars" un atmest parejos, lai uz ekrana paliek tikai Edgars un nekas vairak ka to var izdarit ? Edited October 2, 2010 by dAivEd Quote Link to comment Share on other sites More sharing options...
101111 Posted October 2, 2010 Report Share Posted October 2, 2010 $text = "Edgars"; Ja vienīgais kas tev interesē vārda "Edgars" iegūšana. Ja vārda "Edgars" vietā iespējami arī citi vārdi, tad būtu tev konkrētāk jāpasaka pēc kāda principa meklēt šo vārdu. Quote Link to comment Share on other sites More sharing options...
dAivEd Posted October 2, 2010 Author Report Share Posted October 2, 2010 (edited) $text = "Edgars"; Ja vienīgais kas tev interesē vārda "Edgars" iegūšana. Ja vārda "Edgars" vietā iespējami arī citi vārdi, tad būtu tev konkrētāk jāpasaka pēc kāda principa meklēt šo vārdu. Tu laikam nesaprati :D Man vajag no ta visa tekst'a dabut tikai to vardu, tas teksts izvadas no datubazes. Vinu nevar nomainit pret $text = "Edgars"; ! Edited October 2, 2010 by dAivEd Quote Link to comment Share on other sites More sharing options...
nikidijs Posted October 2, 2010 Report Share Posted October 2, 2010 (edited) Ja runa tieši par šo doto variantu tad: $text = "Chaw mani sauc Edgars"; $vards = explode(" ",$text); echo $vards[3]; Edited October 2, 2010 by nikidijs Quote Link to comment Share on other sites More sharing options...
dAivEd Posted October 2, 2010 Author Report Share Posted October 2, 2010 Ja runa tieši par šo doto variantu tad: $text = "Chaw mani sauc Edgars"; $vards = explode(" ",$text); echo $vards[3]; Hmm, shito es zinu, problema ir taada ka var but ari "Chaw Edgars mani sauc" un visadi shadi veidi, readli man ir no teksta jaatrod vards edgars un jaizvada Quote Link to comment Share on other sites More sharing options...
mickys Posted October 2, 2010 Report Share Posted October 2, 2010 Vārds var būt tikai Edgars? Quote Link to comment Share on other sites More sharing options...
dAivEd Posted October 2, 2010 Author Report Share Posted October 2, 2010 yap! Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted October 2, 2010 Report Share Posted October 2, 2010 Ja jau vārds vienmēr ir Edgars, tad kapēc ne vnk: echo 'Edgars'; Quote Link to comment Share on other sites More sharing options...
nemakuphp Posted October 2, 2010 Report Share Posted October 2, 2010 (edited) $text = 'Chaw mani sauc Edgars'; if(preg_match('/\\bEdgars/', $text)){ $text = 'Edgars'; } Ja tekstā netiks atrasts vārds 'Edgars', tad teksts paliks nemainīgs Edited October 2, 2010 by nemakuphp Quote Link to comment Share on other sites More sharing options...
dAivEd Posted October 2, 2010 Author Report Share Posted October 2, 2010 #gameplace ----------------- #dragstyle^ #erotic #mixzuemvsmums #purvciems #5vs5 #gather.cs #gameplace ----------------- #gameplace ----------------- #mucrop #igo #gameplace #cs.racial #cs.gunz #highpracc #ue #network #5vs5 #mirc.lv #elve #esport.lv #skillz no shiem vardiem ir jaatlasa tikai vaards #gameplace, parejie citi vaardi pazuud, vaitad tik gruuti saprast (sick) ? Piemers ar vardu Edgars ir reali tadspats, neuzheli neviens nevar saprast mani ? Quote Link to comment Share on other sites More sharing options...
nemakuphp Posted October 2, 2010 Report Share Posted October 2, 2010 Kas tevi neapmierina manā piemērā? Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted October 2, 2010 Report Share Posted October 2, 2010 http://uk2.php.net/strpos Quote Link to comment Share on other sites More sharing options...
Val Posted October 2, 2010 Report Share Posted October 2, 2010 Ja jau zini, ko konkrētajā gadījumā vajag atrast, tad kāda jēga vēl tos vārdu pēc tam izvilkt no teksta? Quote Link to comment Share on other sites More sharing options...
Леший Posted October 2, 2010 Report Share Posted October 2, 2010 neuzheli neviens nevar saprast mani ? Tu zini, jā :) Pats savu jautājumu izlasi. Quote Link to comment Share on other sites More sharing options...
dAivEd Posted October 2, 2010 Author Report Share Posted October 2, 2010 akdievs... es esmu shokets Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.