简体   繁体   中英

How to create a multidimensional ForEach loop in php using openSUSE vim editor

I am having trouble creating a ForEach loop to get stock prices from the wsdl file. I attached a screenshot of my code and output. Please advise.

输出和代码截图

Hey you should paste the code, but I made something anyway.

<?php
$url_soap = "url_here";
$client = new SoapClient($url_soap);
$list = array("ibm", "microsoft", "apple", "mcdonald's");
foreach($list as $name){
    $price = $client->getQuote($name);
    echo strtoupper($name)."   ".$price."<br />";
}

You get the price for every item this way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM