Re: 2 questions: Search in array and detect JS
| From: | Jochem Maas | Date: | Mon, 17 Apr 2006 08:57:22 +0000 |
| Subject: | Re: 2 questions: Search in array and detect JS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-234102@lists.php.net to get a copy of this message | ||
1. I'm not the original poster (I wasn't asking a question)
2. don't post me or anyone else 'offlist' unless asked
3. WTF are you talking about?
4. if you say 'First' then that assumes there is a 'Second'
coming. (that's sounds kinda funny given it was just Easter)
suresh kumar wrote:
First,If u want to search work "richard hassed" .firstsplit the word as "richard" and "hassed" by using split() and store it in array.and use select like command to search individual word stored in array.this type of searching is followed in google.A.suresh--- Jochem Maas <jochem@iamjochem.com> wrote:don't know if someone mentioned it already but i was digging around in the docs for something completely different and bumped into this: preg_grep() [http://php.net/preg_grep] and I thought of your question, might be just what your looking for. I can't remember having come across this func before - learn something new every day :-) Ryan A wrote:__________________________________________________________ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.comHi, Like the subject says; I have two questions: 1) Is it possible to detect JavaScript via php...and yes I do know that JSis client side while PHP is server...but how elseto do it?The reason I ask is before serving an AJAX page Iwould like to make sure JSis enabled, if not, serve the other "normalpage"... I am sure I am not thefirst person to come accross this little problem,how did you solve it?I have seen some suggestions on google like havinga hidden form field andusing js to put a value in it, if it exists whenthe form is sent then JSis on..if not, its not... but that method is notthe best in an AJAXsituation...right? 2) How can I search in an array for a particularword?eg: in an array "movie" I have this kind of data: movie_name=> some movie cast=> Jim Carrey, Richard Pryor, Eddie Murphy I want to search on either "Richard" or "RichardPryor" (must be caseinsensitive too) something like a SELECT with a LIKE %% statement I have been fooling around with in_array() but notgetting anywherefast..... am I on the right track? Links, code examples or advise would be asalways....appreciated.Thanks, Ryan-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php