Personal I have 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 />"; }
Problem 1 happens:
- The search is only correct when we put in UPPERCASE, because the result of the jSON is upper case.