alone.hidden
New Member
در ارایه ها چه توابعی لازم است کار کنیم
و اموزش توابع list , key , currect
و اموزش توابع list , key , currect
در ارایه ها چه توابعی لازم است کار کنیم
و اموزش توابع list , key , currect
<?php
foreach ($arrayname as $key => $value) {
// $value => Value of index .
// $key => key of index .
}
?>
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
$result = count($a);
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
echo "Got Irix";
}
$size = "large";
$var_array = array("color" => "blue",
"size" => "medium",
"shape" => "sphere");
extract($var_array, EXTR_PREFIX_SAME, "wddx");
echo "$color, $size, $shape, $wddx_size\n";
$transport = array('foot', 'bike', 'car', 'plane');
$mode = current($transport); // $mode = 'foot';
$mode = next($transport); // $mode = 'bike';
$mode = current($transport); // $mode = 'bike';
$mode = prev($transport); // $mode = 'foot';
$mode = end($transport); // $mode = 'plane';
$mode = current($transport); // $mode = 'plane';
$info = array('coffee', 'brown', 'caffeine');
// Listing all the variables
list($drink, $color, $power) = $info;
echo "$drink is $color and $power makes it special.\n";