半点优化网 http://www.bdxc.net/
当前位置首页 > 网站技术问题> 正文

怎样用PHP来给网页做导航栏

2022-05-17 16:27:55 暂无评论 66 网站技术问题 怎样   导航   网页

/*(string)($page_num+1)将数学运算$page_num+1的结果转化为字符串类型,这样就可以用来与其他字串最终连接成为我们需要的文件名。
  */ /*现在检查文件是否存在(这段代码假设所有的文件都位于同样的目录下),并最终给出构成页面导航栏的HTML代码。
  */ $prev_exists = file_exists($prev_page_file);$next_exists = file_exists($next_page_file);
  if ($prev_exists)
  { print <a $root/$prev_page_file>previous</a>;if ($next_exists)
  { print  | ;} if ($next_exists)
  { print <a $root/$next_page_file>next</a>;}
  ?>

猜你喜欢