PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > Determine if string is all uppercase?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Determine if string is all uppercase?

Réponse
 
LinkBack Outils de la discussion
Vieux 30/09/2007, 06h12   #1 (permalink)
Angela
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Determine if string is all uppercase?

Hello

Is there a simple way to determine if a string is all in uppercase
characters?


Thanks
  Réponse avec citation
Vieux 30/09/2007, 10h18   #2 (permalink)
FD
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Determine if string is all uppercase?

"Angela" <angela@adjingo.com> schreef in bericht
news:QeGLi.34982$nO3.27264@edtnps90...
> Hello
>
> Is there a simple way to determine if a string is all in uppercase
> characters?
>
>
> Thanks


if ($string == strtoupper($string))
echo "It's all uppercase!";

Frank


  Réponse avec citation
Vieux 30/09/2007, 20h45   #3 (permalink)
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Determine if string is all uppercase?

..oO(Angela)

>Is there a simple way to determine if a string is all in uppercase
>characters?


ctype_upper()

Micha
  Réponse avec citation
Vieux 30/09/2007, 23h23   #4 (permalink)
peter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Determine if string is all uppercase?

>
> ctype_upper()


Just a note. That method only works if the string comprises only of letters
(will return false if a space or a number is in the string for example
regardless of whether all letters are uppercase)


  Réponse avec citation
Vieux 01/10/2007, 04h16   #5 (permalink)
Angela
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Determine if string is all uppercase?

peter wrote:
>> ctype_upper()

>
> Just a note. That method only works if the string comprises only of letters
> (will return false if a space or a number is in the string for example
> regardless of whether all letters are uppercase)
>
>


Thanks for the , will try it out

Here are the string I am getting (users are submitting)
Wanting to determine if all words in the string are uppercase

"SELLING NOKIA N95 AT $270, NOKIA E90 COMMUNICATOR AT $300, 8GB APPLE
IPHONE"

"FOR SALE BRAND NEW APPLE IPHONE 8GB"

etc
  Réponse avec citation
Vieux 01/10/2007, 17h52   #6 (permalink)
peter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Determine if string is all uppercase?


> Thanks for the , will try it out
>
> Here are the string I am getting (users are submitting)
> Wanting to determine if all words in the string are uppercase
>
> "SELLING NOKIA N95 AT $270, NOKIA E90 COMMUNICATOR AT $300, 8GB APPLE
> IPHONE"
>
> "FOR SALE BRAND NEW APPLE IPHONE 8GB"
>
> etc


That being the case then the solution FD posted would be best in my
opinion:-

if ($string == strtoupper($string))
{
echo 'is upper';
}


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h53.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08755 seconds with 14 queries