我有一个joomla网站.我有一个index.php,其中包含显示带div的div + HTML代码的PHP代码
我有另一个index.php应该继续使用/ en和/ fr版本.我有另一个版本的index.php,我在上面描述过.我需要在/ ru版本上显示一个index.html,在/ en +/fr版本上显示另一个.
换句话说,我需要回显一些代码mysite.com/ru和mysite.com/en+上的另一个代码mysite.com/fr
<?php
$url = "http://mysite/en/";
$currentpage = $_SERVER['REQUEST_URI'];
if($url==$currentpage) {
echo 'index.html version one'
?>
Run Code Online (Sandbox Code Playgroud)
但这没效果.
使用strpos(): -
if(strpos($url ,'en/') !== FALSE || strpos($url ,'fr/') !== FALSE) {
echo 'index.html version one';
}
if(strpos($url ,'ru/') !== FALSE){
echo 'index.html version two';
}
Run Code Online (Sandbox Code Playgroud)
示例链接: - https://eval.in/734505
参考: - http://php.net/manual/en/function.strpos.php
| 归档时间: |
|
| 查看次数: |
650 次 |
| 最近记录: |