How to use define in php -


I have an array with some key value pairs, which has been rewritten in the number of places in my entire project. Therefore, I want to define and use it in one place.

array is array ('isValid' = & gt; 'wrong', 'message' = & gt; 'invalid login credentials, please try again');

I tried this way, but he has defined the ('ketchavilleiuserssevatspons', array ('isValid' = & gt; 'wrong', 'message' = & gt; Invalid login credentials, please try again '));

Define and use the array at the top, but how some values ​​are not available when I resonate any help really is appreciated.

kCheckValidUserSuccessResponse ;

P> Constants can only evaluate scalar values ​​

  class error {public $ my_error1 = array ('isValid' = & gt; 'false', 'message' = & Gt; 'Please Invalid Login Credential, Please try again'); } $ Error = new error (); Print_r ($ error- & gt; my_error1);  

you can call the error in any of your codes, also be familiar with OP programming.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -