我是新來的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