Re: 2 questions: Search in array and detect JS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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" .first
split 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@xxxxxxxxxxxxx> 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:

Hi,
Like the subject says; I have two questions:

1) Is it possible to detect JavaScript via php...

and yes I do know that JS

is client side while PHP is server...but how else

to do it?

The reason I ask is before serving an AJAX page I

would like to make sure JS

is enabled, if not, serve the other "normal

page"... I am sure I am not the

first person to come accross this little problem,

how did you solve it?

I have seen some suggestions on google like having

a hidden form field  and

using  js to put a value in it, if it exists when

the form is sent then JS

is on..if not, its not... but that method is not

the best in an AJAX

situation...right?


2) How can I search in an array for a particular

word?

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 "Richard

Pryor" (must be case

insensitive too)
something like a SELECT with a LIKE %% statement

I have been fooling around with in_array() but not

getting anywhere

fast..... am I on the right track?
Links, code examples or advise would be as

always....appreciated.

Thanks,
Ryan


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






		
__________________________________________________________ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux