dAivEd Posted March 15, 2009 Report Posted March 15, 2009 Kāda bija funkcija kura parbauda vai varda ir lielie burti ? Vai kautkas tamlidzigs :) Quote
SaMay Posted March 16, 2009 Report Posted March 16, 2009 vispirms jautāsim kā tu to domā? vai tieši tekstā ir lielie burti vai arī ja ir ieslēgts CAPS LOCK taustiņš vai vēl kāds cits variants. Quote
v3rb0 Posted March 16, 2009 Report Posted March 16, 2009 function f($s) { return strtolower($s) != $s; } Quote
darksign Posted March 16, 2009 Report Posted March 16, 2009 (edited) Līdzīga problēma ir aprakstīta šeit: links tur izlīdzējās ar ereg("[A-Z]", ....) funkciju. vēl te viens piemērs: $test1 = "This started with a capital"; $test2 = "this one not"; testCapital($test1); testCapital($test2); function testCapital($aStr) { $firstChar = substr($aStr,0,1); if ($firstChar == mb_strtoupper($firstChar)) { echo "<br>'".$aStr."' starts with a capital."; } else { echo "<br>'".$aStr."' starts NOT with a capital."; } } paartaisi to savaam vajadziibaam un buus ok ;) Edited March 16, 2009 by darksign Quote
dAivEd Posted March 16, 2009 Author Report Posted March 16, 2009 Piemeram tiek ievadits: dAivEd Raada erroru: Nelietojiet lielos burtus! VAI Raada ka lielie burti ir: AE, vai arii atbild ar TRUE un FALSE, TRUE(Ir satura lielais burts) False(nav) Quote
Aleksejs Posted March 16, 2009 Report Posted March 16, 2009 Jautājums: Vai Tevi interesē tikai latīņu burti, vai arī visi iespējamie diakritiskie burti, kirilica, arābu valoda utt? Quote
v3rb0 Posted March 16, 2009 Report Posted March 16, 2009 .. $firstChar = substr($aStr,0,1); if ($firstChar == mb_strtoupper($firstChar)) .. kāda jēga no mb_strtoupper(), ja pirmo burtu ar 'parasto' substr()? Quote
Grey_Wolf Posted March 16, 2009 Report Posted March 16, 2009 function f($s) { return strtolower($s) != $s; } Zetons Tavs :) Idials risinajums uzdotajam jautajumam :) Quote
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.