Check a variable after call it PHP
I have a varaible:
$this->valuepicname = isset($_POST['picname'][$开发者_Go百科numberpicname]) ? $_POST['picname'][$numberpicname] : "";
The varabile $numberpicname is static and each time I call to - it has another value, so, I want to do it too with th varaible $valuepicname - but I can't define it as static ($valuepicname) because its IF statement (i think this is the reason..).
Hope you understand.. (my english is bad) Thank you.
object values in PHP can't be both static and dynamic, which is what you are trying to do by setting it with a boolean. Also, if you want it to be static, why are you calling it using $this?
define("STATIC_STRING", "what ever you want here");
define("STATIC_INT", 100);
define("STATIC_BOOL", TRUE);
if(STATIC_BOOL) {
echo "We have static!!!<br />\n";
}
if(STATIC_INT === 100) {
echo "We have static!!!<br />\n";
}
if(STATIC_STRING != "") {
echo "We have static!!!<br />\n";
}
Something like this?
$this->valuepicname = STATIC_BOOL;
精彩评论