Home >Backend Development >PHP Tutorial >php的if else有关问题?

php的if else有关问题?

WBOY
WBOYOriginal
2016-06-13 10:36:36744browse

php的if else问题???
我是一个新手,今天在修改一个PHP源码的时候因为要用到一个PHP的IF else的问题,还望各位大侠给以帮助。

link.php?id=abc 当没有abc时即id的值为空的时候提示参数不正确,当id的值不为空时执行link.php?id=abc

这个语句怎么写?

------解决方案--------------------
if(isset($_GET['id'])){
//有id

}else{
//没有id 提示代码
}
------解决方案--------------------

PHP code
if(isset($_GET['id'])){    //有id   }else{    //没有id  提示代码}<div class="clear">
                 
              
              
        
            </div>
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
Previous article:求一正则婚配规则写法Next article:数据库跟ajax