0
我從我的PHP文件獲取內容,並希望在一個數組推獲取的結果是一樣的東西:解析內容,並推入陣列
//english error
$lang['error_incorrect_login'] = "The username or password doesn't match. Please try again";
$lang['error_user_exist'] = "The Username already exist in database. Please try using a different Username";
$lang['error_email_exist'] = "Email address already exist in database";
這是我的PHP文件的實際內容
,我需要的結果數組,如:
array(
['error_incorrect_login'] = "The username or password doesn't match. Please try again",
['error_user_exist'] = "The Username already exist in database. Please try using a different Username",
['error_email_exist'] = "Email address already exist in database"
);
其實我是想解析
$lang['error_incorrect_login'] = The username or password doesn't match. Please try again";
語句類型&推入一個數組。
array(
['error_incorrect_login'] = "The username or password doesn't match. Please try again",
['error_user_exist'] = "The Username already exist in database. Please try using a different Username",
['error_email_exist'] = "Email address already exist in database"
);
$ LANG * *是你想要的形式,給人的print_r正是這個。 – davidkonrad
以及它在我的.php文件中作爲內容。我正在使用$ contents = file($ my_php_file);並且如果使用foreach($ contents as $ b => $ v)debug($ v); \t}以上結果出現 –
當然你剛好在'include(file.php);的foreach($ LANG ...' – SmokeyPHP