Is ther any function that I could use to check if a string beguins wiht
a certin set of numbers, like
if string starts_w 324 {
do some stuff;
}
Regards, David
http://www.atom.is/
Davíð Örn Jóhannssson
Vefforritari
Atómstöðin hf.
if(substr($string,0,3) == 123)
{ //do some stuff }
---John Holmes...
- Original Message -
From: David Orn Johannsson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 8:03 AM
Subject: [PHP] String check
Is ther any function that I could use to check if a string
eregi() is the go... whilst the documentation is pretty thin on the actual
expressions, '^' checks for the pattern at the begining of a string.
?
if(eregi('^324', $string)) {
//
// it did begin with 324
//
} else {
//
// it didn't
//
}
?
Justin French
Message -
From: Justin French [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 8:15 AM
Subject: Re: [PHP] String check
eregi() is the go... whilst the documentation is pretty thin on the actual
expressions, '^' checks for the pattern at the begining
4 matches
Mail list logo