Hi,
I’ve created a function to manage errors in php, this is the function:
function km_notice($km_notice_title, $km_notice_message, $km_notice_code, $km_notice_status){
$km_notice = array(
'notice_title' => htmlspecialchars($km_notice_title),
'notice_message' => htmlspecialchars($km_notice_message),
'notice_code' => htmlspecialchars($km_notice_code),
'notice_status' => htmlspecialchars($km_notice_status)
);
return json_encode($km_notice);
}
And then i use it in the following way:
echo km_notice('title', 'message', 'code', 'error');
Now my problem is how can I store messages in a single file so if in the future if I want to change the text I don’t have to edit the specific file containing the message? I suppose I could use constants but I’m wondering if there is another method I’m not aware of. Something a .po file maybe?
many thanks