$pages = array('Text1.php', 'Text2.php', 'Text3.php');
// $currentpage depends the page you're on
$currentId = array_search($currentpage, $pages);
내가 include(Text4.php)
를 통해 액세스하고 include(Text4.php)
배열에서 위의 모든 세 PHP 스크립트에 저장되어있는 PHP 스크립트가 있습니다. 이제는 사용자가 현재있는 페이지와 같아야하고 $pages
의 값과 일치하도록 £currentpage
을 설정합니다.이 값은 현재 페이지의 파일 이름이어야합니다.설정 PHP 변수는 현재 페이지를 찾을 수
제 질문은 위 코드에서 $ currentId 변수를 작성하여 작성한 기능을 수행해야합니다.
마지막 문장 :'$ currentpage' 변수, 그렇습니까? – greg0ire
http://stackoverflow.com/questions/7997016/if-this-page-show-this-else-show-this – andrewk