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.
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...
Hi! Today i am going to share how to get android version using Javascript. Here is the code, <script> function getAndroidVersion(ua) { var ua = ua || navigator.userAgent; var match = ua.match(/Android\s([0-9\.]*)/); return match ? match[1] : false; }; getAndroidVersion(); //"4.2.1" parseInt(getAndroidVersion(),10); //4 parseFloat(getAndroidVersion()); //4.2 </script> Hope you got it. Any queries please leave a comment.
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"}
Comments
Post a Comment