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

Active Directory Authenticated Proxy Server with Squid or CNTLM -

java - @PluginTarget(Node.class) not registering as neo4j plugin -

python - Calculate STD manually using Groupby Pandas DataFrame -