3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "widgetTitle":"Recent History For You", "title_text":"Recent History", "title":"Recent History", "items":[ { "item_type":"product", "adunit_id":null, "name":"Dove Rejuvenated Volume Conditioner (240 ml)", "slug":"dove-rejuvenated-volume-conditioner-240-ml-86", "itemurl":"\/product\/dove-rejuvenated-volume-conditioner-240-ml-86", "category_name":"Conditioner", "stock_status":"1", "p_group":null, "thumb_image_url":"\/\/media6.ppl-media.com\/tr:h-235,w-235,c-at_max\/static\/img\/product\/141295\/dove-rejuvenated-volume-conditioner-240-ml_4_display_1476255016_7fe66d85.jpg", "primary_image_url":"\/\/media6.ppl-media.com\/tr:h-550,w-550,c-at_max\/static\/img\/product\/141295\/dove-rejuvenated-volume-conditioner-240-ml_4_display_1476255016_7fe66d85.jpg", "avg_rating":4, "total_rating":"13", "product_seller_id":"126619", "seller_id":"321", "price":"250", "mrp":"250", "offer_price":"200", "our_price":"200", "specialofferPrice":"200", "discount":"20", "offer_discount":0, "total_discount":20, "offer_text":"", "discount_price":50, "isincart":0, "iscart":0, "incart":0, "isliked":0 }, { "item_type":"product", "id":"107816", "adunit_id":null, "name":"Schwarzkopf Gliss Hair Repair With Liquid Keratin Serum Deep Repair Conditioner (200 ml)", "slug":"schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml", "itemurl":"\/product\/schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml", "category_name":"Conditioner", "stock_status":"1", "p_group":null, "thumb_image_url":"\/\/media6.ppl-media.com\/tr:h-235,w-235,c-at_max\/static\/img\/product\/107816\/schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml_1_display_1506591377_c984d6fc.jpg", "primary_image_url":"\/\/media6.ppl-media.com\/tr:h-550,w-550,c-at_max\/static\/img\/product\/107816\/schwarzkopf-gliss-hair-repair-with-liquid-keratin-serum-deep-repair-conditioner-200-ml_1_display_1506591377_c984d6fc.jpg", "avg_rating":2.5, "total_rating":"3", "product_seller_id":"97130", "seller_id":"276", "price":"295", "mrp":"295", "offer_price":"266", "our_price":"266", "specialofferPrice":"266", "discount":"10", "offer_discount":0, "total_discount":10, "offer_text":"", "discount_price":29, "isincart":0, "iscart":0, "incart":0, "isliked":0 } ], "type":"Recent", "x_id":"1", "widget_id":"rh", "ictk":0, "cr":"", "if_from_cache":0, "version":"v_1", "widget_name":"rh", "reco_type":"rh", "widget_type":"product", "widget_view_type":"product", "text":"History", "page":"product", "status":"success" }'; $jsonArr = json_decode($json, true); $chars = preg_split('/product\//', $jsonArr['items'][0]['primary_image_url']); preg_match('/^\d+/', $chars[1], $matches); print_r($matches); $chars2 = preg_split('/product\//', $jsonArr['items'][1]['primary_image_url']); preg_match('/^\d+/', $chars2[1], $matches2); print_r($matches2);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 141295 ) Array ( [0] => 107816 )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
131.61 ms | 405 KiB | 5 Q