Code: Select all
<?
function test ($a, &$b)
{
..
.
.
}
?>
ขอบคุณฮะ
Moderators: mindphp, ผู้ดูแลกระดาน
Code: Select all
<?
function test ($a, &$b)
{
..
.
.
}
?>
Code: Select all
<?php
function pass_by_value($param) {
push_array($param, 4, 5);
}
$ar = array(1,2,3);
pass_by_value($ar);
foreach ($ar as $elem) {
echo "<br/>" . $elem;
}
?>
Code: Select all
1,2,3
Code: Select all
<?php
function pass_by_reference(&$param) {
push_array($param, 4, 5);
}
$ar = array(1,2,3);
pass_by_reference($ar);
foreach ($ar as $elem) {
echo "<br/>" . $elem;
}
?>
Code: Select all
1,2,3,4,5
Users browsing this forum: No registered users and 12 guests