im trying to make a search function for my website, but i cannot get it to work. here is my code:
$search_string = "html documentation";
$search_string = explode(' ', $search_string);
$array = "
Array (
[0] => Array (
[0] => 404
[1] => notfound
[2] => error
)
[1] => Array (
[0] => 403
[1] => forbidden
[2] => error
)
[2] => Array (
[0] => home
)
[3] => Array (
[0] => hcjp
[1] => html
[2] => css
[3] => js
[4] => php
[5] => learning
[6] => documentation
)
[4] => Array (
[0] => about
)
[5] => Array (
[0] => search
[1] => search on no conditions
)
[6] => Array (
[0] => search
[1] => search on label
)
)
";
$search_result = in_array($search_string, $array);
print_r($search_result);
i am not getting any output, my goal is to get some sort of path like: [3], so that i know that:
$search_result[3]
contains info the user requested.
thanks