- var_export: documentation ( source)
- define: documentation ( source)
<?php
define('LANGUAGE_NONE', 'und');
$node = new stdClass();
$node->type = 'tv_show';
if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE]) && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) {
echo "1st check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n";
}
else {
echo "1st check: field_show_type is empty\n";
}
if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) {
echo "2nd check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n";
}
else {
echo "2nd check: field_show_type is empty\n";
}
$node->field_show_type[LANGUAGE_NONE][0]['value'] = 'test';
if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE]) && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) {
echo "1st check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n";
}
else {
echo "1st check: field_show_type is empty\n";
}
if ($node->type == 'tv_show' && !empty($node->field_show_type[LANGUAGE_NONE][0]['value'])) {
echo "2nd check: " . var_export($node->field_show_type[LANGUAGE_NONE][0]['value'], TRUE) . "\n";
}
else {
echo "2nd check: field_show_type is empty\n";
}