چاپ کردن arguments ها توسط for و foreach
<?php
// functions arguments
function productAll () {
return $allProduct = func_get_args();
}
$args = productAll("huawei" , "samsung" , "blackberry" ,"htc" , "LG" , "one plus","LG","iphone" );
$size = sizeof($args);
for ($i = 0 ; $i < $size ; $i++ ) {
echo "brand : $args[$i]<br>";
}
echo "<hr>";
foreach($args as $arg){
echo "brand : $arg<br>";
}