[PHP] String check

2002-04-30 Thread David Orn Johannsson
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.

Re: [PHP] String check

2002-04-30 Thread 1LT John W. Holmes
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

Re: [PHP] String check

2002-04-30 Thread Justin French
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

Re: [PHP] String check

2002-04-30 Thread 1LT John W. Holmes
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