<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Parsing ARRAY]]></title><description><![CDATA[<p dir="auto">Ciao a tutti ho un problema nell'eseguire il parsing di un Array in php.</p>
<p dir="auto">Via allego il codice PHP e l'estratto Array:</p>
<p dir="auto"><strong>PHP:</strong></p>
<p dir="auto"><strong>```php</strong><br />
<strong>$url = "<a href="https://vulners.com/api/v3/audit/audit/?os=redhat&amp;version=7.1&amp;package=redhat-release-server-7.2-9.el7.x86_64" rel="nofollow ugc">https://vulners.com/api/v3/audit/audit/?os=redhat&amp;version=7.1&amp;package=redhat-release-server-7.2-9.el7.x86_64</a>";</strong></p>
<pre><code>**$cURL = curl_init();**
**curl_setopt($cURL, CURLOPT_URL, $url);    curl_setopt($cURL, CURLOPT_HTTPGET, true);    curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);    $result = curl_exec($cURL);    curl_close($cURL);**    
**$jsonData = json_decode($result, true);**

**foreach ($jsonData as $valore)    {        echo $valore['package'];        echo '&lt;pre&gt;'; var_dump($item);            }**
</code></pre>
<p dir="auto"><strong>```</strong></p>
<p dir="auto"><strong>Array:</strong></p>
<pre><code>Array(    [result] =&gt; OK    [data] =&gt; Array        (            [packages] =&gt; Array                (                    [redhat-release-server-7.2-9.el7.x86_64] =&gt; Array                        (                            [RHSA-2017:3108] =&gt; Array                                (                                    [0] =&gt; Array                                        (                                            [package] =&gt; redhat-release-server-7.2-9.el7.x86_64                                            [providedVersion] =&gt; 0:7.2-9.el7                                            [bulletinVersion] =&gt; 7.2-9.el7_2.3                                            [providedPackage] =&gt; redhat-release-server-7.2-9.el7.x86_64                                            [bulletinPackage] =&gt; redhat-release-server-7.2-9.el7_2.3.x86_64.rpm                                            [operator] =&gt; lt                                            [bulletinID] =&gt; RHSA-2017:3108                                            [cvelist] =&gt; Array                                                (                                                )                                            [fix] =&gt; sudo yum -y update redhat-release-server                                        )                                )                            [RHSA-2017:1384] =&gt; Array                                (                                    [0] =&gt; Array                                        (                                            [package] =&gt; redhat-release-server-7.2-9.el7.x86_64                                            [providedVersion] =&gt; 0:7.2-9.el7                                            [bulletinVersion] =&gt; 7.2-9.el7_2.2                                            [providedPackage] =&gt; redhat-release-server-7.2-9.el7.x86_64                                            [bulletinPackage] =&gt; redhat-release-server-7.2-9.el7_2.2.x86_64.rpm                                            [operator] =&gt; lt                                            [bulletinID] =&gt; RHSA-2017:1384                                            [cvelist] =&gt; Array                                                (                                                )                                            [fix] =&gt; sudo yum -y update redhat-release-server                                        )                                )                        )                )            [vulnerabilities] =&gt; Array                (                    [0] =&gt; RHSA-2017:3108                    [1] =&gt; RHSA-2017:1384                )            [reasons] =&gt; Array                (                    [0] =&gt; Array                        (                            [package] =&gt; redhat-release-server-7.2-9.el7.x86_64                            [providedVersion] =&gt; 0:7.2-9.el7                            [bulletinVersion] =&gt; 7.2-9.el7_2.3                            [providedPackage] =&gt; redhat-release-server-7.2-9.el7.x86_64                            [bulletinPackage] =&gt; redhat-release-server-7.2-9.el7_2.3.x86_64.rpm                            [operator] =&gt; lt                            [bulletinID] =&gt; RHSA-2017:3108                            [cvelist] =&gt; Array                                (                                )                            [fix] =&gt; sudo yum -y update redhat-release-server                        )                    [1] =&gt; Array                        (                            [package] =&gt; redhat-release-server-7.2-9.el7.x86_64                            [providedVersion] =&gt; 0:7.2-9.el7                            [bulletinVersion] =&gt; 7.2-9.el7_2.2                            [providedPackage] =&gt; redhat-release-server-7.2-9.el7.x86_64                            [bulletinPackage] =&gt; redhat-release-server-7.2-9.el7_2.2.x86_64.rpm                            [operator] =&gt; lt                            [bulletinID] =&gt; RHSA-2017:1384                            [cvelist] =&gt; Array                                (                                )                            [fix] =&gt; sudo yum -y update redhat-release-server                        )                )            [cvss] =&gt; Array                (                    [score] =&gt; 0                    [vector] =&gt; NONE                )            [cvelist] =&gt; Array                (                )            [cumulativeFix] =&gt; sudo yum -y update redhat-release-server            [id] =&gt; AZP2HVGJ3L3M6FYL28K4YDNGW8CRN19P49V4Y6X3501J67W1SMSCM9MXNC5DVGWG4X8ON5ZM0RLYK7XB818IHUA6GHL737M2P4VQ250SHLDE2IZUY4F3GATSRQX8XBLX        ))
</code></pre>
<p dir="auto">Quello che vorrei fare,  è il parsing solamente di alcuni valori come package...<br />
Non mi funziona, dove sbaglio ?<br />
Grazie a tutti.</p>
]]></description><link>https://dev.connect.gt/topic/232786/parsing-array</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 15:54:22 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/232786.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 17 Dec 2017 14:01:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Parsing ARRAY on Tue, 20 Feb 2018 09:22:18 GMT]]></title><description><![CDATA[<p dir="auto">Beh tu tiri fuori tutti i valori. Se ne vuoi uno nello specifico basta fare un "if" dentro al ciclo foreach.</p>
]]></description><link>https://dev.connect.gt/post/1244336</link><guid isPermaLink="true">https://dev.connect.gt/post/1244336</guid><dc:creator><![CDATA[portapipe]]></dc:creator><pubDate>Tue, 20 Feb 2018 09:22:18 GMT</pubDate></item></channel></rss>