Sum Businnes Day with PHP
function sum_business_day($date, $days) { list($year, $month, $day) = explode('-', $date); $business_day = 0; $add_day = 0; while ($add_day < $days) { $business_day++; $wday = gmdate('w',...
View ArticleOutput while running (PHP)
ob_start(); for($i=0; $i<3; $i++) { echo 'printing...'; echo str_repeat(' ', 65536); // set a minimum output ob_flush(); flush(); usleep(300000); }
View ArticleAdd PHPUnit to your Include Path (eclipse based IDE)
1 – Choose “Project” -> “Properties” or “Window” -> “Preferences” -> “PHP” (for global usage) 2 – Choose “PHP Include Path” 3 – Click on “Add External Source Folder” (typically PHPUnit is...
View ArticleInstall composer
Composer is a dependency management for PHP and writen in PHP curl -s https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin/ alias composer='/usr/local/bin/composer.phar'
View ArticleInput is not proper UTF-8, indicate encoding (DOMDocument::loadXML)
Probably your XML string isn’t in UTF-8. Try this: utf8_encode($xml);
View ArticleCatch SoapClient Exception
If you can’t get SoapClient exception if WSDL cant be loaded (PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn’t load from xxx) Try this (before instantiating SoapClient): xdebug_disable(); Found this...
View Articleshow full var_dump
Just update xdebug.ini file xdebug.var_display_max_depth = -1 xdebug.var_display_max_children = -1 xdebug.var_display_max_data = -1 Refs:...
View ArticleInstall Oracle Client on Ubuntu (PHP)
Download Instant Client on: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html - oracle-instantclient11.2-basic-11.2.0.3.0-1.i386.rpm -...
View ArticleIntroduction
Hi, Today I decided to write about some Design Patters I’m currently studying for my future reference and I hope it’ll be helpful for you too. Each post on this post series will be based on books,...
View Article