note 34672 added to function.array-push
| From: | stick dot admin at wanadoo dot fr | Date: | Sun, 03 Aug 2003 14:03:49 +0000 |
| Subject: | note 34672 added to function.array-push | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53265@lists.php.net to get a copy of this message | ||
Exemple d'utilisation de tableau avec ARRAY.
-------------------------------------------
<?
function displayArray($arLink)
{
print_r($arLink);
}
function addUrl(&$arLink,$Url,$Description)
{
$arId = count($arLink);
$arTmp = array($arId => array(0 => $Url, 1 => $Description));
$arLink = $arLink + $arTmp;
}
function displayUrl($arLink,$id)
{
echo '<a
href=\"'.$arLink[$id][0].'\">'.$arLink[$id][1].'</a>';
}
$arLink = array(
0 => array(0 => 'http://www.google.fr',
1 => 'Moteur de recherche')
);
displayUrl($arLink, 0);
addUrl($arLink,'http://stick.hn.org','Site
cannabis');
addUrl($arLink,'http://membres.lycos.fr/stickadmin','Site
cannabis');
displayArray($arLink);
?>
----
Manual Page -- http://www.php.net/manual/en/function.array-push.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34672
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34672&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34672&report=yes