I recently needed to get the current time in milliseconds, of course this can easily be retrieved using microtime() however I needed the entire number in digits, not in decimals with seconds seperately etc. Heres how:
$timeparts = explode(" ",microtime());
$currenttime = bcadd(($timeparts*1000),bcmul($timeparts,1000));
NOTE: PHP5 is required for this function due to the improvements with microtime() and the bc math module is also required (as we’re dealing with large numbers, you can check if you have the module in phpinfo).
I recently came across:
/bin/bash^M: bad interpreter: No such file or directory
When trying to run a bash script that someone else had edited. This most commonly happens on UNIX systems if the file has been edited on MS-DOS or Mac. The cure for this is to run a simple perl script:
Save as unix2dos.pl, chmod +x unix2dos.pl and then run like:
Whilst working on FetchMP3 I wanted to create a bridge between the forum membership system and that of the main site’s. So a lot of writing later the vbulletin bridge was born. It has many of the features any membership system would need such as:
Its Almost Done!
Its been a long time coming but I’m finally re-developing my site, I’ve been pre-occupied recently with the latest project I worked on, FetchMP3, but I’m now finally getting my act together and adding content etc. Most of the portfolio has been updated now but the main content is still being written. Stay tuned!
Programming since I was 13 (2003) I have had a lot of experience working with information technology. Originally starting coding very basic, messy, HTML I have now had over 8 years of working with the language, now of course using tidy XHTML and CSS stylesheets. Continue reading