- var_dump: documentation ( source)
<?php
$string = 'this is a string';
// Test 1
if (isset($string['check'][0])) {
echo 'found';
} else {
echo 'not found';
}
echo '<hr />';
// Test 2
if (isset($string[0])) {
echo 'found';
} else {
echo 'not found';
}
echo '<hr />';
// Test 3
if (isset($string['check'])) {
echo 'found';
} else {
echo 'not found';
}
echo '<hr />';
// Test 4
if (isset($string['check'][100])) {
echo 'found';
} else {
echo 'not found';
}
echo '<hr />';
var_dump($string['check'][0]); // Warning throw out