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

Home >Backend Development >PHP Tutorial >php语法解决思路

php语法解决思路

WBOY
WBOYOriginal
2016-06-13 11:49:46929browse

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;

Statement:
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