Skip to content

Haversine formula with php

I want to use this formula with php. I have a database with some values of latitute and longitude saved. I want to find, with a certain value of latitude and longitude in input, all the distances (in km) from this point with each point in the database. To do this, I used the formula on googlemaps api: Of cour…

Fatal Error – Too many open files

I try to run PHPUnit Tests in my new machine and I get this error: PHP Fatal error: Uncaught exception ‘UnexpectedValueException’ with message ‘RecursiveDirectoryIterator::__construct(/usr/lib/php/pear/File/Iterator): failed to open dir: Too many open files’ in /usr/lib/php/pear/File/I…

Get Specific Device Information

Using just PHP, is there anyway to detect if the page is being loaded from a SPECIFIC device? Say, I would want the page to react differently if only MY iPhone was loading the page, no one else’s? The only solution I have so far is to use $_SERVER[‘REMOTE_PORT’ in conjunction with $_SERVER[&…