0

How do I identify the nth position of an inputted keywords (including numbers) through a n html search form?

Eg: keyword1 keyword2 keyword3

position of keyword1 = 1
position of keyword2 = 2
position of keyword3 = 3

And then use that nth keyword to query a particular field in mysql tables.

Thanks!

Edited by hmphf: n/a

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by hmphf
0

Yep, arrays. Here a hint:

explode using a space as a delimiter
apply the 'key + 1' as the position for a value. This is because array keys start at 0 by default.

0

Thanks. Sorry for the late response. I could solve the problem with explode() and then using count() and list().

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.