PHP

Stay ahead with the latest trends in custom software development. Explore how AI, automation, and cloud solutions are shaping the future of business technology.

PHP – Basic Fork Example

<?   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);         } […]
Continue Reading

2002 Cannot log in to the MySQL server – MAC

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 […]
Continue Reading

PHP Date

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 […]
Continue Reading