Click Fraud Protection
PHP related blog, freelancer to hire!

Posts Tagged php

Prime numbers in PHP – quick and efficient way

Looking for a way to find prime numbers in php? I wfound one perl solution here, but it wasn’t perl magic – it was power of regular expressions. Please find code below which will be self-explanatory. <?php /** * Function checks if given number is prime *

Read more

Run PHP (and others) code in a browser – revolutionary pastebin

If you need to test a code in browser – try Entry found on

Read more

Geotagging script

PHP Geotagging script Script converts visitor’s ip adress into : country code (2 and 3 letter ISO code) full english country name region code and name currency code used in this country postal code gps coordinates area code dma code metro code and BONUS overall statitics about

Read more

PHP Mail problem on Ubuntu

I’ve installed fresh version of Ubuntu 9.04 with Lamp, but I couldn’t send emails outside. Problem was SMTP auth of outgoing server, spending time found who made my day. Thanks

Read more

sFTP for PHP 5.xx

Install SSh2 extension for PHP, then you can use class below: <?php /** * Class to deal with sFTP connections * to use install * */ class SFTPConnection { private $connection; private $sftp; public function __construct($host, $port=22) { if (!extension_loaded(‘ssh2’)) { throw new Exception(“Extension ssh2 has

Read more

PHP CLI Progress Indicator

Today I wanted to create some progress indicator PHP command line, after minute googling I found After slight change: function progressBar($current, $total, $label) { $percent = round($current / $total * 100); if ($current == 0) { if ($label == “”) echo “Progress: \n”; else if ($label

Read more