|
|
|
Array 1 key , 2 value ต้องทำไงคับ ใครเก่ง array ช่วยด้วยคับ |
|
|
|
|
|
|
|
ทางแก้ :)
<?php
$array=array('firstlink'=>array('link'=>'www.111.com',
'title'=>'this is 111',
'linkname'=>'111'),
'secondlink'=>array('link'=>'www.222.com',
'title'=>'this is 222',
'linkname'=>'222')
);
foreach($array as $key=>$value){
echo "<a href='{$value['link']}' title='{$value['title']}'>{$value['linkname']} </a> <br />";
}
?>
|
ประวัติการแก้ไข 2011-12-16 16:33:57
|
|
|
|
Date :
2011-12-16 16:29:19 |
By :
thaicloud |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php
$arr = array(
1 => array('title' =>'111', 'link'=>'www.222.com', 'text'=>'one one one'),
2 => array('title' =>'222', 'link'=>'www.222.com', 'text'=>'two two two')
);
foreach($arr as $value) {
echo "<a href=".$value['link']." title=".$value['title'].">".$value['text']."</a><br />";
}
?>
|
|
|
|
|
Date :
2011-12-16 16:33:38 |
By :
ไวยวิทย์ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากๆๆๆ คับ
|
|
|
|
|
Date :
2011-12-16 16:40:17 |
By :
nutnarakja |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|