[$\s]*([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('abc2' == $_GET['type']){ $page = file_get_contents('https://www.abcbullion.com.au/store/gold/gabg05abc-5oz-cast'); if(preg_match("'

[$\s]*([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('abc3' == $_GET['type']){ $page = file_get_contents('https://www.abcbullion.com.au/store/gold/gabg10abc-10oz-cast'); if(preg_match("'

[$\s]*([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('abc4' == $_GET['type']){ $page = file_get_contents('https://www.abcbullion.com.au/store/gold/abc-gold/gabg3215abc-1kg-cast'); if(preg_match("'

[$\s]*([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('abc5' == $_GET['type']){ $page = file_get_contents('https://www.abcbullion.com.au/store/silver/abc-silver/sabc3215abc-1kg-cast'); if(preg_match("'

[$\s]*([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('abc6' == $_GET['type']){ $page = file_get_contents('https://www.abcbullion.com.au/store/silver/pamp-silver/spamp3215pamp-1kg-cast'); if(preg_match("'

[$\s]*([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('abc7' == $_GET['type']){ $page = file_get_contents('https://www.abcbullion.com.au/store/silver/skc1001oz-kookaburra-2015'); if(preg_match("'

[$\s]*([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('perth1' == $_GET['type']){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" ) ); $context = stream_context_create($opts); $page = file_get_contents('http://www.perthmintbullion.com/au/Buy-Gold-Bars/1oz-Cast.aspx?productId=18', false, $context); //echo $page; if(preg_match("/volumeBreaks.*=\s([\d.]+);/", $page, $price)){ echo json_encode((float)$price[1]); }else{ echo json_encode(false); } } if('perth2' == $_GET['type']){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" ) ); $context = stream_context_create($opts); $page = file_get_contents('http://www.perthmintbullion.com/au/Buy-Gold-Bars/5oz-Cast.aspx?productId=20', false, $context); //echo $page; if(preg_match("/volumeBreaks.*=\s([\d.]+);/", $page, $price)){ echo json_encode((float)$price[1]); }else{ echo json_encode(false); } } if('perth3' == $_GET['type']){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" ) ); $context = stream_context_create($opts); $page = file_get_contents('http://www.perthmintbullion.com/au/Buy-Gold-Bars/10oz-Cast.aspx?productId=21', false, $context); //echo $page; if(preg_match("/volumeBreaks.*=\s([\d.]+);/", $page, $price)){ echo json_encode((float)$price[1]); }else{ echo json_encode(false); } } if('perth4' == $_GET['type']){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" ) ); $context = stream_context_create($opts); $page = file_get_contents('http://www.perthmintbullion.com/au/Buy-Gold-Bars/1kg-Cast.aspx?productId=23', false, $context); //echo $page; if(preg_match("/volumeBreaks.*=\s([\d.]+);/", $page, $price)){ echo json_encode((float)$price[1]); }else{ echo json_encode(false); } } if('perth5' == $_GET['type']){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" ) ); $context = stream_context_create($opts); $page = file_get_contents('http://www.perthmintbullion.com/au/Buy-Silver-Bars/1kg.aspx?size=27', false, $context); //echo $page; if(preg_match("/volumeBreaks.*=\s([\d.]+);/", $page, $price)){ echo json_encode((float)$price[1]); }else{ echo json_encode(false); } } if('perth6' == $_GET['type']){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" ) ); $context = stream_context_create($opts); $page = file_get_contents('', false, $context); //echo $page; if(preg_match("/volumeBreaks.*=\s([\d.]+);/", $page, $price)){ echo json_encode((float)$price[1]); }else{ echo json_encode(false); } } if('perth7' == $_GET['type']){ $opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n" ) ); $context = stream_context_create($opts); $page = file_get_contents('http://www.perthmintbullion.com/au/Buy-Silver-Coins/1oz.aspx?size=18', false, $context); //echo $page; if(preg_match("'volumeBreaks.1.\s=\s([\d.]+);'si", $page, $price)){ echo json_encode((float)$price[1]); }else{ echo json_encode(false); } } if('ainslie1' == $_GET['type']){ $page = file_get_contents('https://www.ainsliebullion.com.au/products/gold-bullion/1oz-ainslie-gold-bullion/tabid/85/type/1/guid/5d2c3425-d06d-487c-8384-1cd72e1c1950/default.aspx'); if(preg_match("'AUD.([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('ainslie2' == $_GET['type']){ $page = file_get_contents('https://www.ainsliebullion.com.au/products/gold-bullion/5oz-ainslie-gold-bullion/tabid/85/type/1/guid/cfc8a6fe-1635-4434-b21f-8071bbb5de4b/default.aspx'); if(preg_match("'AUD.([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('ainslie3' == $_GET['type']){ $page = file_get_contents('https://www.ainsliebullion.com.au/products/gold-bullion/10oz-ainslie-gold-bullion/tabid/85/type/1/guid/1de4ad34-fdcb-4252-9dbd-524af63b3f6e/default.aspx'); if(preg_match("'AUD.([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('ainslie4' == $_GET['type']){ $page = file_get_contents('https://www.ainsliebullion.com.au/products/gold-bullion/1kg-ainslie-gold-bullion/tabid/85/type/1/guid/48fda7f8-4e70-4b74-a67c-2e7e9638064c/default.aspx'); if(preg_match("'AUD.([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('ainslie5' == $_GET['type']){ $page = file_get_contents('https://www.ainsliebullion.com.au/products/silver-bullion/1kg-ainslie-silver-bullion/tabid/85/type/2/guid/484924f6-01bb-4d72-888f-6bebbeadc935/default.aspx'); if(preg_match("'AUD.([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('ainslie6' == $_GET['type']){ $page = file_get_contents('https://www.ainsliebullion.com.au/products/silver-bullion/1kg-silver-bullion-pamp-w-certificate-/tabid/85/type/2/guid/db3c810d-bee4-466e-a22e-d78512996c58/default.aspx'); if(preg_match("'AUD.([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } } if('ainslie7' == $_GET['type']){ $page = file_get_contents('https://www.ainsliebullion.com.au/products/silver-bullion/1oz-pm-silver-coins-kookaburra/tabid/85/type/2/guid/c8fea838-6c2e-40ca-a4ae-868d4f3928d8/default.aspx'); if(preg_match("'AUD.([\d,.]+)'si", $page, $price)){ echo json_encode((float)str_replace(',','',$price[1])); }else{ echo json_encode(false); } }