Category Archives: PHP

How to convert date MM/DD/YYYY to YYYY-MM-DD

How to convert date MM/DD/YYYY to YYYY-MM-DD In real time development we usually come across this issue. But converting the date MM/DD/YYYY to YYYY-MM-DD is really simple using the PHP date function and strtotime() function. In many cases we show different date format like MM/DD/YYYY to users in the application but we need to convert… Read More »

Get client real ip address in PHP

Get client real ip address in PHP [dropcap]In[/dropcap] php we can use superglobal variable $_SERVER to get client informations. $_SERVER is an array containing client informations such as ip address, headers, paths. We can not say all the details will be available in the variable. It depends on the server configurations. Many servers gives $_SERVER[‘REMOTE_ADDR’]… Read More »

How to check if the request is made via ajax in PHP

How to check if the request is made via ajax in PHP [dropcap]N[/dropcap]owadays most of the website uses ajax requests for different purposes. To load a page, to load extra contents, to load images, and many others. And many of the sites are using the ajax request in the login and registration forms. So how… Read More »