3
Guys I got the following json:
"results": {
"collection1": [
{
"prod": {
"text": "COLCHÃO NAUTIKA KING SIZE"
I have a search form:
<form id="search" method="POST">
<input type="text" name="search" />
<input type="submit" value="buscar">
</form>
And to show the result I did the following:
$search = $_POST['search'];
foreach($results['results']['collection1'] as $collection) {
if(strpos($collection['prod']['text'],$search) !== false) {
echo $collection['prod']['text'] . "'><br />"; }
It happens 1 problem:
- The search is only right when put in UPPERCASE letter, because the result of json is uppercase.
Cool! Just fixing an error: if(strpos($Collection['Prod']['text'], "MATTRESS") !== false)
– GustavoCave
I had done it right after I edited and put an extra one. Missed to give compilation error!
– Thiago Silva