-
-
Recent Posts
Recent Comments
Categories
- Bash
- BerkeleyDB
- Browsers
- Cable
- Chrome
- Cool Problems
- CPAN
- CSS
- Data Structures
- Databases
- DNS
- Editors
- Errors
- Everything Else
- Fedora
- Firefox
- Firewall
- Flash
- Forking
- Hardware
- HTML
- ImageMagick
- Images
- Internet Explorer
- IpTables
- Lingo
- Linux
- Log4perl
- Mediawiki
- Monitoring
- Munin
- MySQL
- Netgear
- Perl
- PHP
- PhpMyAdmin
- Postfix
- Regular Expressions
- Routers
- RPM
- Samba
- Screen
- SSH
- SSHFS
- Subversion
- Synergy
- Troubleshooting
- Ubuntu
- VIM
- Windows
- Windows Vista
- Wordpress
- YUM
Blogroll
Archives
Tags
September 2010 M T W T F S S « Aug 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Meta
CNN.com- Bonnie Blue actress from 'GWTW' dies
- President to aides: Find economic spark
- Hurricane Earl downgraded as it approaches East Coast
- Workers rescued after oil platform fire
- BP uncaps oil well in Gulf
- Mideast peace talks start
- Convicted killer spared death penalty
- Opinion: Social Security can help states
- U.S., Iran battle on basketball court
- She drops 100 pounds, gains new life
BBC- Europe agrees finance watchdogs
- ICC chief executive on cricket charges
- Explosion on Gulf of Mexico rig
- Tanker runs aground off N Canada
- DCAL cuts 'will mean job losses'
- Pakistan trio hit by ICC charges
- Strike 'kills Afghan civilians'
- Bid for Middle East peace begins
- The mint with a whole lot of food miles
- Man 'strangled wife and hid body'
AL JAZEERA ENGLISH (AJE)
Category Archives: PHP
PHP: How To Get A Time Difference in Human Readable Format
A simple function to return the time since a given timestamp in the past. function time_since($timestamp) { // Init $hash = array(); $now = time(); // Breakdown the time diff $diff = $now – $timestamp; $hash['day'] = floor($diff / 86400); … Continue reading
PHP: Pass By Reference vs. Pass By Value
By default, PHP is pass by value. <? function pass_by_value($param) { push_array($param, 4, 5); } $ar = array(1,2,3); pass_by_value($ar); foreach ($ar as $elem) { print "<br>$elem"; } ?> The code above prints 1, 2, 3. This is because the array … Continue reading
Posted in PHP
Leave a comment
Perl Version of PHP's "ucwords" Function
my $string = ‘this is a string of text’; $string =~ s/\b(\w+)\b/ucfirst($1)/ge; print “$string\n”;
Posted in PHP, Perl
Leave a comment
How To Merge PHP Objects
foreach($objectA as $k => $v) $objectB->$k = $v;
Posted in PHP
Leave a comment
Minimal PhpMyAdmin new server config
Besides the boilerplate at the top, here’s the least you need to add another database server to the dropdown list in PhpMyAdmin: $i++; $cfg['Servers'][$i]['auth_type'] = ‘cookie’; $cfg['Servers'][$i]['host'] = ‘my.host.com’;
Posted in Linux, PhpMyAdmin
Leave a comment
How to Write to STDERR in PHP
Writing to standard error in PHP: fwrite(STDERR, “hello error string\n”); Useful for standalone PHP scripts.
Posted in PHP
Leave a comment