RE: [PHP] searching an array for words starting with 'p'
I don't think there's a builtin that does exactly what you are looking for, but this will do the trick: -Joseph Rosenblum President, 25th Street Networks Easy, Reliable PHP Web Hosting at: http://www.25thstreet.net/ -Original Message- From: andy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 30, 2002 8:37 AM To: [EMAIL PROTECTED] Subject: [PHP] searching an array for words starting with 'p' Hi there, I am wondering how to search an array for words starting with a certain character. E.G: $word = array('alpha', 'beta', 'php'); I would like to check if there is a word in the array starting with p Is there alrready a function for this? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] searching an array for words starting with 'p'
try preg_grep() http://www.php.net/manual/en/function.preg-grep.php example: Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "andy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 10:36 AM Subject: [PHP] searching an array for words starting with 'p' > Hi there, > > I am wondering how to search an array for words starting with a certain > character. > > E.G: > > $word = array('alpha', 'beta', 'php'); > > I would like to check if there is a word in the array starting with p > > Is there alrready a function for this? > > Thanx, Andy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] searching an array for words starting with 'p'
Hi there, I am wondering how to search an array for words starting with a certain character. E.G: $word = array('alpha', 'beta', 'php'); I would like to check if there is a word in the array starting with p Is there alrready a function for this? Thanx, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php