One of the sites that I’m working on at the moment requires some IP-specific functionality, but in testing I realised that the standard $_SERVER['REMOTE_ADDR'] wasn’t being as accurate as I wanted. Then I realised that this variable doesn’t take into consideration visitors accessing via a proxy server or any random proxy/caching stuff put in place by their ISP.
So, I put together this simple little function that returns the actual IP of any visitor… Read the rest of this entry »
I put this block of code together for some freelance work I’ve recently completed, where the client needed to be able to have dynamic control of content and assign these pieces of content to various files in the website. The easiest way to do this, especially for future expansion, was to use the following code to generate a list of all files in the directory.
Read the rest of this entry »
PHP lets developers output strings to the screen using single or double quotation:
print ‘Hello world’;
print “Hello world”;
Both of these statements product the exact same output to the screen in terms of what the browser sees. However, these is a distinct difference in how PHP handles these statements.
Read the rest of this entry »
Recent Comments