I am a PHP developer since 2009. I am very good in designer as well. My career starts with a web designer then i learnt php frameworks and CMS. Also learnt mobile version - JQuery.
My ambition is to learn more in my day to day life. I am here to share my knowledge.
To display array values in JSON format, you need to use json_encode(). For eg: $arr = array('username' => 'test','userid' =>'1', 'password' => 'test123'); // Use json_encode to return in json format echo json_encode($arr); Output: {"username":"sham dhar","userid":"36","password":"test123"}
Hi !!! Today i am going to share how to set up the virtual host in local machine with the Apache Server. In my tutorial i have used WAMP server. What is Virtual Host? Virtual Host is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers). This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name. How to setup Virtual Host in Server? 1. Add Host to your Hosts file. For adding you have to locate below file, C:\Windows\System32\drivers\etc\hosts Open "hosts" file in notepad and add below line after 127.0.0.1 Localhost 127.0.0.1 yourwebsite.local Here "yourwebsite.local" will point to your server on local machine. 2. Next step is to enable vhosts in apache. Open your httpd.conf file which is located under, C:\wamp\bin\apache\apache2.2.22\conf Here, You have to uncomment below...
Here is the code to validate for birthdate, //Validate for users below 18 only function birthdate($then, $min) { // $then will first be a string-date $then = strtotime($then); //The age to be less than 18 $min = strtotime('+18 years', $then); if(time() < $min) { return false; } else { return true; } }
Comments
Post a Comment