var_dump $ _GET返回null或在wordpress中不起作用

时间:2016-08-22 19:24:33

标签: php wordpress

我在wordpress中遇到GET请求问题 我什么时候

 $post_ide = $_GET['post-id'] ;


 var_dump($_GET['post-id']);

当我转到linke example.com/?post-id=300时,我有没有GET post-id和var_dump返回null的linke examole.com

谁能帮助我? 谢谢

2 个答案:

答案 0 :(得分:0)

使用example.com/?post_id=300和

代替变量名中的连字符
$post_id = $_GET['post_id'];
var_dump( $post_id );

答案 1 :(得分:0)

试试这个:

h