Klez Posted July 27, 2005 Report Share Posted July 27, 2005 man vaik lai stringaa var buut tikai burti, gan lieli gan mazi ... vienalga if(ereg('[^0-9]{1,}', $name)) return false; // ir kkas no cipariem tik taalu esmu ticis ... bet manupraat vieglaak buutu noraadiit ar preg_match ka var buut tikai burti (lielie un mazie) \d any decimal digit \D any character that is not a decimal digit \s any whitespace character \S any character that is not a whitespace character \w any "word" character \W any "non-word" character sanaak ka \w bet tur gadiijumaa nebuus arii visi simboli ??? Link to comment Share on other sites More sharing options...
Analgiins Posted July 28, 2005 Report Share Posted July 28, 2005 if (preg_match('/^[A-Za-z]+$/', $strings)) { echo 'tikai burti'; } else { echo 'nav tikai burti'; } maybe shitas der Link to comment Share on other sites More sharing options...
bubu Posted July 28, 2005 Report Share Posted July 28, 2005 if (ctype_alpha($text)) { echo 'sastāv tikai no burtiem'; } else { echo 'nav tikai burti'; } Link to comment Share on other sites More sharing options...
Klez Posted July 28, 2005 Author Report Share Posted July 28, 2005 paldies bubu ... domaaju ka shis variants buus aatraaks par preg .. :) Link to comment Share on other sites More sharing options...
Delfins Posted July 29, 2005 Report Share Posted July 29, 2005 paldies bubu ... domaaju ka shis variants buus aatraaks par preg .. :) 20023[/snapback] to var noskaidrot tikai ielienot sourcē. Kāda vaina pregiem? tev žēl tās 1 mikrosekundes?! un ja vajadzēs tomēr arī ciparus? mainīsi visu rindu, vai vnk pielikt klāt 0-9 !? :) Link to comment Share on other sites More sharing options...
Klez Posted July 29, 2005 Author Report Share Posted July 29, 2005 nu aatraaks katraa gadiijuma buus par preg ... :) var jau patesteeties ... :) Link to comment Share on other sites More sharing options...
Recommended Posts