Create the function sortArray() public function sortArray(&$array, $subkey=”id”, $sort_ascending=true) { if (count($array)) $temp_array[key($array)] = array_shift($array); foreach($array as $key => $val){ $offset = […]
echo “PATH=/opt/plesk/php/7.1/bin:$PATH” >> ~/.bash_profile Replace the version number with the one you have set. Then close out the terminal and reopen. Run […]
// Disable gateway based on country function payment_gateway_disable_country( $available_gateways ) { global $woocommerce; if ( isset( $available_gateways[‘cod’] ) && $woocommerce->customer->get_country() <> ‘IN’ […]
Each YouTube video has 4 generated images. They are predictably formatted as follows: http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg The first one in the […]
//Easy way to print from php or just plain command line. exec(“lpr [ options ] [ filename … ]”); //Gettinga little Fancy cat thesis.txt | lpr //Another example exec(“lpr -P printer -r […]