Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// Menghilangkan variabel data
//$data = null;
if (array_key_exists('data', get_defined_vars())) {
echo 'Data is set.';
} else {
echo 'Data is not set.';
}
// Hasil:
// Data is not set.
// ---------------------------------------------------
// Deklarasi variabel data
$data = null;
if (array_key_exists('data', get_defined_vars())) {
echo 'Data is set.';
} else {
echo 'Data is not set.';
}
// Hasil:
// Data is set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment