php_Stopp Posted October 10, 2005 Report Share Posted October 10, 2005 .. kas paarbauda, vai dati sastāv tikai no latīņu alfabēta burtiem ? nu.. un cipariem. Link to comment Share on other sites More sharing options...
Delfins Posted October 10, 2005 Report Share Posted October 10, 2005 (edited) $bool = eregi( '^[a-z0-9]+$', $text ); Edited October 10, 2005 by Delfins Link to comment Share on other sites More sharing options...
php_Stopp Posted October 10, 2005 Author Report Share Posted October 10, 2005 (edited) paldies edit: pag, pag.. šitais kods skatīsies, cik simbolu savienojumus 'a-z0-9' satur $text , ne tā ? ja tas $text buutu 'esa-z0-9esmua-z0-9cilveks', tad $bool būtu 2 Edited October 10, 2005 by php_Stopp Link to comment Share on other sites More sharing options...
php_Stopp Posted October 10, 2005 Author Report Share Posted October 10, 2005 aa, nu izmainīji ;) paldies :) Link to comment Share on other sites More sharing options...
spynode Posted October 13, 2005 Report Share Posted October 13, 2005 (edited) Bool nevar buut 2. Tas offtopic. Pamaniiju, ka runa iet par mainiigo $bool. sorry Edited October 13, 2005 by spynode Link to comment Share on other sites More sharing options...
ohmygod Posted October 13, 2005 Report Share Posted October 13, 2005 Bool nevar buut 2. Tas offtopic. Pamaniiju, ka runa iet par mainiigo $bool. sorry 24571[/snapback] Mainīgais bool var gan būt 2, var arī būt 'gurķis' 2 nevar būt mainīgā vērtība ar tipu boolean! Link to comment Share on other sites More sharing options...
Kavacky Posted October 13, 2005 Report Share Posted October 13, 2005 (edited) bool eregi ( string pattern, string string [, array regs]) Tas nosaukums tur nebija tāpat vien. Edited October 13, 2005 by Kavacky Link to comment Share on other sites More sharing options...
ohmygod Posted October 13, 2005 Report Share Posted October 13, 2005 bool eregi ( string pattern, string string [, array regs]) Tas nosaukums tur nebija tāpat vien. 24586[/snapback] $bool, nevis bool !! Manis pēc tur var būt $varchar, $eregi, $hipopotams vai dajebkas cits - mainīgais ir un paliek mainīgais, dotajā gadījuma tas tikai var dot mājienu, kādus datus tas varētu saturēt. neko citu! Link to comment Share on other sites More sharing options...
Delfins Posted October 13, 2005 Report Share Posted October 13, 2005 patiesībā jau atgirež INT.. bet pamatā to izmanto tā if ( !eregi(..) ) { print error( "kaut kas nav tā" ); } PS: tas bija tikai kā mājiens... Link to comment Share on other sites More sharing options...
php_Stopp Posted November 10, 2005 Author Report Share Posted November 10, 2005 (edited) un vēl kas - kā var pārbaudīt, vai mainīgais satur visus (tai skaitā utf-8 kodētus) simbolus ? ;) sāku lasīt eregi() komentārus manualī, bet nu varbūt tomēr kāds var pateikt, līdz man akal uznāk iedvesma lasīt.. (jau izbesījās lasīt tur - nekā nav) :) Edited November 10, 2005 by php_Stopp Link to comment Share on other sites More sharing options...
bubu Posted November 10, 2005 Report Share Posted November 10, 2005 Var paņemt un pārbaudīt vai visi simboli ir UTF-8 korektā kodējumā: http://en.wikipedia.org/wiki/UTF8#Description (tās tabula trešā kolonna). Link to comment Share on other sites More sharing options...
php_Stopp Posted November 10, 2005 Author Report Share Posted November 10, 2005 (edited) sorry, mazliet laboju - nevis visus simbolus, bet jebkuru simbolu.. sorry, sorry :P galīgi saputrojos. laikam jau gulēt pa naktīm vajag :P forget.. Edited November 10, 2005 by php_Stopp Link to comment Share on other sites More sharing options...
Recommended Posts