function is_var($var){//???How to write}$a = 123;var_dump(is_var($a));//true
var_dump(is_var('456')) ;//falsevar_dump(is_var(456));//falsevar_dump(is_var([1,2,3]));//false...
That is, pass the parameters directly If a value is written, false is returned. If a variable is defined, true is returned.
Is there any way? . .
Can I judge that the one with $ in front is a variable? I am a novice and I am just talking nonsense.
How can I edit a post without deleting it? . . . The first time I posted, it showed up in a mess. . .
function is_var($var){
//???How to write
}
$a =123;
var_dump(is_var ($a));//true
var_dump(is_var('456'));//false
var_dump(is_var(456));// false
var_dump(is_var([1,2,3]));//false
......
That is, if you pass the parameter and write the value directly, return false , if a variable is defined, return true
Is there any way? . .