1 Replies - 343 Views - Last Post: 05 December 2012 - 04:18 AM

#1 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

cant find two string/num functions

Posted 05 December 2012 - 02:50 AM

hi iam looking for two function

1st question i want to test if there is a number in string. for ex $st1,$st2,$st3.
$st1 = "wht3";    //error
$st2 = "jit2j";   //error
$st3 = "6fik";    //error
$st4 = "fkif";    //ok




2nd question i want to test if the 1st char of string is a number.
$st1 = "3fef";  //error
$st2 = "52fes"; //error
$st2 = "jkk3"; //ok
$st3 = "fj2if"; //ok


i was thing of using if statment but cant seem to find two right functions.

This post has been edited by Dormilich: 05 December 2012 - 04:16 AM
Reason for edit:: please use [CODE] [/CODE] tags when posting code


Is This A Good Question/Topic? 0
  • +

Replies To: cant find two string/num functions

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,232
  • Joined: 08-June 10

Re: cant find two string/num functions

Posted 05 December 2012 - 04:18 AM

I would recomment a regular expression. e.g. preg_match()
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1