Logo
  • Home
  • About
  • Services
  • Career
  • Blogs
  • Contact
Logo

The UK's #1 Software Development Company. PodTech IO builds custom software solutions for businesses. Call today for a free consultation

  • Address

    4th Floor, 4 Tabernacle Street London EC2A 4LU
  • Email

    info@podtech.com
  • Contact

    +44 (0) 20 8720 6583

Category Archives: PHP

  • Home
  • Category Archives

PHP – Basic Fork Example

  • By podtech
  • In PHP

<?   print “Starting main program\n”; $childs = array();   for ( $count = 1; $count <= 10; $count++) {         $pid = pcntl_fork();         if ( $pid == -1 ) {                 // Fork failed                           echo “Fork failed\n”;                 exit(1);         } else if ( $pid ) {                 # parent                 #print “pid is $pid, parent $$\n”;                 array_push($childs, $pid);         } […]

Read More

Debugging PHP – Parse error: syntax error, unexpected $end

  • By podtech
  • In PHP

Debugging PHP – Parse error: syntax error, unexpected $end If you have are using the short form <?  for PHP instead of the long form <?php you might be faced with this parse error when running your script on different systems: Update all references to the long version <?php Ensure that all linked files also […]

Read More

2002 Cannot log in to the MySQL server – MAC

  • By podtech
  • In PHP SQL

2002 Cannot log in to the MySQL server – MAC To fix In /etc/php.ini, replaced the three occurences of /var/mysql/mysql.sock with /tmp/mysql.sock prompt% sudo chmod u+w php.ini   <- had to give myself write permission to that file.. you may need to become root user to actually edit the file.. depends who owns php.ini Now edit […]

Read More

Open_basedir issues

  • By podtech
  • In PHP

Open_basedir issues Check /var/www/php-fcgi-scripts/web4/.php-fcgi-starter    

Read More

PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/imagick.ini on line 1 in Unknown on line 0

  • By podtech
  • In PHP

PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/imagick.ini on line 1 in Unknown on line 0   Just change the ‘#’ in the files to ‘;’ and this error will stop!

Read More

PHP Date

  • By podtech
  • In PHP

The PHP date() function is used to format a time and/or date. The PHP Date() Function The PHP date() function formats a timestamp to a more readable date and time. A timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred. Syntax date(format,timestamp) Parameter Description format Required. Specifies […]

Read More

PHP Array

  • By podtech
  • In PHP

PHP Array An array stores multiple values in one single variable. What is an Array? A variable is a storage area holding a number or text. The problem is, a variable will hold only one value. An array is a special variable, which can store multiple values in one single variable. If you have a […]

Read More

GET or POST – Secure

  • By podtech
  • In Perl PHP

GET or POST – Secure GET is NOT Secure GET is not a secure method of sending data. Don’t use it for forms that send password info, credit card data or other sensitive information. Since the data is passed through as part of the URL, it’ll show up in the web server’s logfile (complete with […]

Read More

Given a size in KB, try to return a more readable MB, GB or TB answer string

  • By podtech
  • In PHP

Given a size in KB, try to return a more readable MB, GB or TB answer string function readable_size_for_kb($mykb) { if ( $mykb > 1073741824 ) { return sprintf(“%5.1f TB”,$mykb / 1024 / 1024/1024); } elseif ( $mykb > 1048576 ) { return sprintf(“%5.1f GB”,$mykb / 1024 / 1024); } elseif ( $mykb > 1024 […]

Read More

Readable Time – PHP, given a unix timestamp, return a readable time

  • By podtech
  • In PHP

Readable Time – PHP, given a UNIX timestamp, return a readable time # Given a unix timestamp, returns in readable time ie “1 day, 7 hours, 23 minutes, 2 seconds” function readable_time($timestamp, $num_times = 2) { //this returns human readable time when it was uploaded (array in seconds) $times = array(31536000 => ‘year’, 2592000 => […]

Read More

Recent Posts

  • DevOps as a Software Development Methodology
  • How Does Spiral Software Development Methodology Work?
  • Waterfall Software Development Methodology And When To Use It
  • What Exactly Is Lean Software Development Methodology?
  • What is Kanban and How Does It Work?

PodTech IO

The UK's #1 Software Development Company. PodTech IO builds custom software solutions for businesses. Call today for a free consultation

Company

  • About
  • Services
  • Contact
  • Blogs
  • Career

Terms

  • Terms & Conditions
  • Privacy Policy

Contact Us

  • ADDRESS

    Headquarter: Tabernacle Street London India: Vi john Tower, Gurgaon, Haryana
  • EMAIL

    info@podtech.com
  • CONTACT

    +44 (0) 20 8720 6583

Copyright ©2023 PodTech IO. All Rights Reserved

Logo