Jump to content
php.lv forumi

funkcija čeko vai ir lielie burti


dAivEd

Recommended Posts

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 by darksign
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...