Trong dòng cuối cùng của mã sau, mã này có &2, if($page['special']&2).
& in & 2 có nghĩa là gì trong PHP?
& có nghĩa là gì?
if(isset($_REQUEST['id']))$id=(int)$_REQUEST['id'];
else $id=0;
if($id){ // check that page exists
$page=dbRow("SELECT * FROM pages WHERE id=$id");
if($page!==false){
$page_vars=json_decode($page['vars'],true);
$edit=true;
}
}
if(!isset($edit)){
$parent=isset($_REQUEST['parent'])?(int)$_REQUEST['parent']:0;
$special=0;
if(isset($_REQUEST['hidden']))$special+=2;
$page=array('parent'=>$parent,'type'=>'0','body'=>'','name'=>'','title'=>'','ord'=>0,'description'=>'','id'=>0,'keywords'=>'','special'=>$special,'template'=>'');
$page_vars=array();
$id=0;
$edit=false;
}
// { if page is hidden from navigation, show a message saying that
if($page['special']&2)echo '<em>NOTE: this page is currently hidden from the front-end navigation. Use the "Advanced Options" to un-hide it.</em>';
bản sao có thể có của [Tham khảo - Biểu tượng này có ý nghĩa gì trong PHP?] (Http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php) – Gordon
Trong bối cảnh của câu hỏi này và là một phần của toán học nhị phân, không phải là toán tử 'by reference' – Dmitri
@Dmitri trường hợp đó cũng được đề cập trong tham chiếu được liên kết. – Gordon