PHP Store array values -


Hi I'm using Maxmind minfraud. And I got the result like this:

An =; CountryCode = in; Ip_region = 25; Ip_city =; Ip_latitude = 10.0223; Ip_longitude = 30.2433; HighRiskCountry = No; QueriesRemaining = 1075; CityPostalMatch =; ShipCityPostalMatch =; Ip_domain =; Ip_countryName =; Ip_continentCode = as; Ip_corporateProxy = No; ShipForward = NA; RiskScore = 0.20; Prepaid =; Minfraud_version = 1.3

Here I want to return as an array. Price

  & lt; php function fraudQuery ($ ip, $ COUNTRY_CODE, $ state, $ city, $ AREA_CODE, $ MAIL_DOMAIN, $ address) {$ d = file_get_contents ( "https: / /minfraud.maxmind.com/app/ccv2r?license_key=". IP_LOOKUP_KEY. "& amp; i = $ ip & amp; country = $ country_code & amp; city = $ city & amp; postal = $ area_code & amp; domain = $ mail_domain & amp; shipAddr = $ address & amp; shipCity = at $ city & amp; shipRegion in = $ state & amp ; ShipPostal = $ AREA_CODE & amp; ShipCountry = $ COUNTRY_CODE "); Return array ( 'errors' = & gt; Hey,' IpCountryCode '= & gt; countryCode,' IpCountry '= & gt; ip_countryName,' IpRegionCode '= & gt; ip_region,' IpRegion '= & gt; ip_regionName,' IpCity '= & Gt; ip_city' IpHostName '= & gt; ip_domain,' score '=> riskScore); }? & Gt;  

How to return to the array value such as the value. Thank you

Use

  parse_str (str_replace ( ';' , '& Amp;', $ yourresultfromURL), $ matcharray);  


Explanation:

Place ; By & amp ;. that is to bring inorder parse_str format and in the end they matched $ matcharray is moved to the array


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -