$v){ if($v[affiliati"/> $v){ if($v[affiliati">

php语法解决思路

WBOY
Release: 2016-06-13 11:49:46
Original
882 people have browsed it

php语法
function seo($ident)
{
include APP_PATH."/plus/seo.cache.php";
$seo=$seo[$ident];
if(is_array($seo)){
foreach($seo as $k=>$v){
if($v[affiliation]!=""){
[email protected](",",$v['affiliation']);
if($_SESSION[did]!="" && in_array($_SESSION['did'],$did)){
$seo=$v;
}elseif(in_array("0",$did)){
$seo=$v;
}
}else{
$seo=$v;
}
}
}
}


上面方法中$seo=$seo[$ident]这种格式是什么意思
------解决方案--------------------
$seo 之前是一个数组,将$seo数组的$ident key对应的元素赋值给 $seo
相当于覆盖了$seo

例如
$a = array('key1'=>1,'key2'=>2,'key3'=>3);
$ident = 'key1';
$a = $a[$ident]; // $a['key1'] 的值是1,等于把1赋值给$a
执行完后
$a = 1;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!