How to use variable inside parameter $_GET? example: ($_GET[$my_var])

后端 未结 4 1027
太阳男子
太阳男子 2021-01-26 07:23

I\'m developing a plugin for wordpress, the parameter of the $ _GET is recorded in the database according to the preference of the User via the Wordpress Admin Panel. The follow

4条回答
  •  心在旅途
    2021-01-26 07:56

    if($_GET[$url_before] != ""){ 
        if($_GET[$url_before]=="nosupport"){ // note no "" here
            // my function goes here...
        }
    }
    

    In your solution, the key was treated as a string, with no variables evaluated.

提交回复
热议问题