我是新来的PHP,我有这样的代码:作为变量的PHP数组?
if(!$form['profile_hunter']['field_profile_hunter_location']['und']['0']['value']['#default_value']){
$form['profile_hunter']['field_profile_hunter_location']['und']['0']['value']['#default_value'] = $default_city;
}
它的工作,但我不喜欢它是那么长,所以我改变:
$form_location = $form['profile_hunter']['field_profile_hunter_location']['und']['0']['value']['#default_value'];
if(!$form_location){
$form_location = $city;
}
然后它不工作,为什么?
详细说明“不工作”... – prodigitalson