Jump to content

Passing an array to a method


atholon

Recommended Posts

All i  can think off function or a define.

<?php


function show_a(){

$a=array("hi ","there"," im"," redarrow");

foreach ($a as $b){

echo $b;
}
}


function show_b(){

$a=array("i"," love"," php");

foreach ($a as $b){

echo $b;
}
}

show_a();
echo"<br>";
show_b();


define("NAME","i am redarrow");
define("PROGRAMMING","i love php programming");

$a=array(NAME,PROGRAMMING);

echo " <br> <br> $a[0] <br> $a[1]";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.