|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Check to see if var is String or Integer
How can I check a string to see if it consists of a string or an integer? I have tried:
if($var >=1 || $var == 0) But even if there is not # and just a string it thinks that it is equats to 0. Sometimes the number may be 0. Is there a function that checks this, like the JS isNaN? |
|
#2
|
|||
|
|||
|
I found one way to accomplish what I want:
if($var >=1 || $var == '0') |
|
#3
|
||||
|
||||
|
I believe you are talking about php...
For simple usage, see functions like is_string() or is_integer(). For more advanced comparisons, use regExp.
__________________
KK Mediat - a professional search engine optimization company that helps you to achieve higher search engine placement and increased web site traffic. 2K also provides some nifty SEO tools like 2KRT: Free Google Keyword Ranking and Tracking Tool |
![]() |
| Viewing: SEO Chat Forums > Other > SEO Scripts > Check to see if var is String or Integer |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|