1
問題が残っています。私は範囲内のjson配列要素をリストする必要があります。json配列をPHPの価格帯にリストアップ
$search = $_POST['search'];
$cat_id = $_POST['category'];
$post1 = file_get_contents("....?search=".$search."&category=".$cat_id);
$data = CJSON::decode($post1, true);
$products = $data['products'];
$pricerange = $_POST['pricerange'];
$myArray = explode('-',$pricerange);
$a =explode('$',$myArray[0]);
$b =explode('$',$myArray[1]);
$a
Controllerページ........行う方法を知ってはいけないの下限であると$b
が上限である、$products
がリストされなければならJSON配列であります。
$products
の価格帯を$a
から `$ b 'に設定する方法を知る必要があります。 $製品
Array
(
[0] => Array
(
[id] => 11027
[title] => SPIDERMAN ENGRAVED LIGHTER
[barcode] => LEN-0022
[qty] => 8
[url] => http://www.ebay.com/itm/-/381279328138?
[retail_price] => 9.99
[category] => Array
(
[id] => 34
[name] => ENGRAVED LIGHTERS
)
[bin] => Array
(
[id] => 346
[name] => F10
)
[images] => Array
(
[0] => Array
(
[small] => http://www.heygidday.biz/portal//timthumb.php?src=/files/products/dscn124900.jpg&w=30
[middle] => http://www.heygidday.biz/portal//timthumb.php?src=/files/products/dscn124900.jpg&w=100
[source] => http://www.heygidday.biz/portal/files/products/dscn124900.jpg
)
)
)
[1] => Array
(
[id] => 11548
[title] => SPIDER MAN Black Lighter
[barcode] => LEN-0067
[qty] => 6
[url] => http://www.ebay.com/itm/-/361369988738?
[retail_price] => 10.99
[category] => Array
(
[id] => 34
[name] => ENGRAVED LIGHTERS
)
[bin] => Array
(
[id] => 346
[name] => F10
)
[images] => Array
(
[0] => Array
(
[small] => http://www.heygidday.biz/portal//timthumb.php?src=/files/products/len-00670.jpg&w=30
[middle] => http://www.heygidday.biz/portal//timthumb.php?src=/files/products/len-00670.jpg&w=100
[source] => http://www.heygidday.biz/portal/files/products/len-00670.jpg
)
)
)
)
の 出力はこれで私を助けてください.......
役立つはずですアレイを並べ替えて並べ替える – HKumar
価格帯の範囲でこの配列をソートする方法 –
mysqlクエリを使って試しましたか?それはより簡単で速くなります – HKumar