how to identify Letter v Number in string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joboils@hotmail.com

    how to identify Letter v Number in string

    I'm at a pretty early stage of learning php and I'm looking to be able
    to examine a string and tell which each character in that string is -
    a letter or a number. I've tried php.net but I'm either asking the
    wrong questions or I don't understand the answers.
    Any help gratefully received.
  • Edward Z. Yang

    #2
    Re: how to identify Letter v Number in string

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    joboils@hotmail .com wrote:
    I'm at a pretty early stage of learning php and I'm looking to be able
    to examine a string and tell which each character in that string is -
    a letter or a number. I've tried php.net but I'm either asking the
    wrong questions or I don't understand the answers.
    Any help gratefully received.
    ctype_alpha($te xt); // alphabetic within current locale
    ctype_digit($nu m); // digits 0-9

    - --
    Edward Z. Yang GnuPG: 0x869C48DA
    HTML Purifier <htmlpurifier.o rg Anti-XSS HTML Filter
    [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (MingW32)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFGU0IpqTO +fYacSNoRAmhWAK CCHotagBG4HHOSh Tm+zN6CkzxINACf YGKW
    2RqstIrlopvptQs 00pEsT3k=
    =08y1
    -----END PGP SIGNATURE-----

    Comment

    • joboils@hotmail.com

      #3
      Re: how to identify Letter v Number in string

      On Tue, 22 May 2007 15:19:05 -0400, "Edward Z. Yang"
      <edwardzyang@th ewritingpot.com wrote:
      >-----BEGIN PGP SIGNED MESSAGE-----
      >Hash: SHA1
      >
      >joboils@hotmai l.com wrote:
      >I'm at a pretty early stage of learning php and I'm looking to be able
      >to examine a string and tell which each character in that string is -
      >a letter or a number. I've tried php.net but I'm either asking the
      >wrong questions or I don't understand the answers.
      >Any help gratefully received.
      >
      >ctype_alpha($t ext); // alphabetic within current locale
      >ctype_digit($n um); // digits 0-9
      Thank you, that looks like what I wanted. I'll be checking it out
      later on this week, but does the ctype_aplha() identify spaces, too?

      Comment

      • Edward Z. Yang

        #4
        Re: how to identify Letter v Number in string

        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        joboils@hotmail .com wrote:
        Thank you, that looks like what I wanted. I'll be checking it out
        later on this week, but does the ctype_aplha() identify spaces, too?
        ctype_alpha does not accept spaces.

        - --
        Edward Z. Yang GnuPG: 0x869C48DA
        HTML Purifier <htmlpurifier.o rg Anti-XSS HTML Filter
        [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]]
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.4.6 (MingW32)
        Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

        iD8DBQFGVLpwqTO +fYacSNoRAtKwAJ 94STn300kB/iruGWJ0lrl39SJk kgCeKgIv
        l5m3FI7kEuGBkce OSTdTR2Q=
        =JryD
        -----END PGP SIGNATURE-----

        Comment

        • joboils@hotmail.com

          #5
          Re: how to identify Letter v Number in string

          On Wed, 23 May 2007 18:04:32 -0400, "Edward Z. Yang"
          <edwardzyang@th ewritingpot.com wrote:
          >-----BEGIN PGP SIGNED MESSAGE-----
          >Hash: SHA1
          >
          >joboils@hotmai l.com wrote:
          >Thank you, that looks like what I wanted. I'll be checking it out
          >later on this week, but does the ctype_aplha() identify spaces, too?
          >
          >ctype_alpha does not accept spaces.
          Boo-hoo. But thank you anyway!

          Comment

          Working...