本節(jié)視頻15:25處,為什么 url 中沒(méi)有加articles的 GET 請(qǐng)求,response 不報(bào)錯(cuò)?
如題。
如果 url 為http://api.com/restful/ ,此時(shí)打印$path為空,使用print_r($_SERVER);打印出的信息中,沒(méi)有PATH_INFO,報(bào)錯(cuò)Undefined index: PATH_INFO。 為什么老師的不報(bào)錯(cuò)呢?
我回到視頻一開(kāi)始,restful/index.php只有print_r($_SERVER);查看http://api.com/restful/articles/ 的信息, 其中[REQUEST_URI] => /restful/articles/,而視頻中老師的是完整路徑 http://api.com/restful/articles/ , 請(qǐng)問(wèn)是為什么?