Hello,
Can anyone please explain the isset and unset functions in php in relation to javascript (this will make it easier)
Hello,
Can anyone please explain the isset and unset functions in php in relation to javascript (this will make it easier)
I have a script.
PHP Code:<?php
$var = "some string"
if(isset($var)) { //Returns true, the variable is set.
unset($var); // undoes the variable
echo $var; //echoes nothing.
}
?>
Thanks for that simple example !
Is there anything else to isset function apart from checking if things are set ?
Well thanks for your help![]()
It can check if a given item exists in an array, too.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
What do you mean ? do you mean something like isset(sesion_start()) ?
No he means:
PHP Code:<?php
$arr = array(
"key"=>"val",
"num"=>"1234",
"letter"=>"abc",
"nonalphnum"=>"!@#$"
);
if(isset($arr["num"])){
echo "The value is set"; //echos if it is set
echo $arr["key"]; //echos "val"
unset($arr["key"]);
echo $arr["key"]; //echos nothing, because it doesnt exist.
}
?>
OK thanks i see![]()
Bookmarks