How do you check if a variable has been set in php?



How do you check if a variable has been set in php?..

Answer / Sunder Singh

"In PHP, to check if a variable has been set, you can use the isset() function. Here's an example:

```php
$variable = 10; // This variable is declared and has a value
if (isset($variable)) {
echo 'Variable is set.';
}
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

How do you debug php?

1 Answers  


What are the rules for naming a php variable?

1 Answers  


What is isset function in php?

1 Answers  


How can I use single quotes in single quotes in php?

1 Answers  


What is Different between Joomla And Magento?

1 Answers  


how to use particular city location in php?

1 Answers   TCS,


what is session_set_save_handler in PHP?

1 Answers  


Which is the latest version of php?

1 Answers  


Is age interval or ordinal?

1 Answers  


Where is session value stored php?

1 Answers  


What is the scope of a variable defined in a function?

1 Answers  


Is not null mysql?

1 Answers  


Categories