I created the keys with openssl using:generate a 1024 bit rsa private key, ask for a passphrase to encrypt it and save to file.openssl genrsa -des3 -out /path/to/privatekey 1024generate the public key for the private key and save to fileopenssl rsa -in /path/to/privatekey -pubout -out /path/to/publickey

$preparedReport = array( 0=>array('name'=>'Alf','revenue'=>1000), 1=>array('name'=>'Boor','revenue'=>3000), 2=>array('name'=>'Cat','revenue'=>4000),);usort($preparedReport, 'sortByRevenueOrder');// use $this in object context //usort($preparedReport, array($this, 'sortByRevenueOrder'));function sortByRevenueOrder($a, $b) { if ($a['revenue'] == $b['revenue']) { return 0; } return ($a['revenue'] > $b['revenue']) ? 1 : -1; // ascending order // return ($a['revenue'] < $b['revenue']) ? 1 : -1; descending order

This is a simple way to back up your database everydayGo to ubuntu command line and log in as root user, type following command to open crontab file >crontab -e type the following command in the file 0 0 * * * mysqldump -uYOURUSER -pYOURPASSWORD YOURDBNAME > /home/tommy/my_back_up/mydb_`date +\%y-\%m-\%d`.sql you can restart cron by typing >restart cron OR >/etc/init.d/cron restartThis ...

/** * Converts minutes to hours * @param type $mins * @return string */ public static function m2h($mins) { if ($mins < 0) { $min = Abs($mins); } else { $min = $mins; } $H = Floor($min / 60); $M = ($min - ($H * 60)) / 100; $hours = $H + $M; if ($mins < 0) { $hours = ...

If you need an array representation of a calender month this function will come in handy. This functionwill return an array of a given month with days properly distributed in to weeks, as in real calendar.public function buildMonthCalendar($year, $month) { $calendar = array( 'week-1' => array('Mon' => null, 'Tue' => null, 'Wed' => null, 'Thu' => null, 'Fri' => null, ...

1. Append the following line to your /etc/apache2/apache2.conf . NameVirtualHost 127.0.0.2:802 . Create unique files for each of my domains within the /etc/apache2/sites-available/ folder.Create a fie called mysitename.com<VirtualHost 127.0.0.2:80>ServerName mysitename.comServerAlias www.mysitename.comServerAdmin me@ubuntu.comDocumentRoot /var/www/mysitename/html</VirtualHost>3. Enable it by creating a symbolic link from one folder to the next ( etc/apache2/sites-enabled/)sudo a2ensite mysitenam

1.Create a folder in C:\xampp\htdocs\mysite2. Edit your hosts file in windows located in C:\WINDOWS\system32\drivers\etc\ and add following line127.0.0.1 mysite.localhostDon’t delete the existing “127.0.0.1 localhost” line3.Open your C:\xampp\apache\conf\extra\httpd-vhosts.conf file and add the following linesNameVirtualHost *:80<VirtualHost *:80> DocumentRoot "C:\xampp\htdocs" ServerName localhost</VirtualHost><VirtualHost *:80> ServerName mysite.localhost DocumentRoot C:\xampp\htdocs\mys

Pass the frequency and current date to get an array of dates.eg.getDatesForYear(4,'2011-01-01');the array you get will have the following dates"2011-04-30","2011-08-31","2011-12-31"public function getDatesForYear($monthlyFequency,$date){$dateParts = explode("-",$date); $firstDayOfTheYear = $dateParts[0] . '-01-01'; $lastDayOfTheYear = $dateParts[0] . '-12-31'; $i = $firstDayOfTheYear;for(strtotime($i);strtotime($i)<=strtotime($lastDayOfTheYear);) { $accruDate[] = date('Y-m-d',strtotime($i . " +$monthlyFe

Previous Page