#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Uruguay
    Posts
    338
    Rep Power
    14

    Just only one one-digit number


    Hello,
    I need to check if $string contains only one one-digit number.
    123uijder false
    3oplidryteerrd true
    3ikid3ed false
    qpoeumjd false
    kikfi8kikko true
    lopw4 true

    Thanks a lot
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Uruguay
    Posts
    338
    Rep Power
    14
    I was quite simple

    if(preg_match_all("/\d/",$string, $matches) == 1)

IMN logo majestic logo threadwatch logo seochat tools logo