Skip to content

How should I be setting browscap.ini file

I downloaded the browscap.ini file and then pasted it to the directory “C:wampbinphpphp5.4.3extras” and i went to php.ini file and made these changes there: [browscap] ; http://php.net/browscap …

Programmatically Create Menu Item in Joomla

I have created a component in joomla 2.5 that creates a new article and adds that article to a menu item. Creating the article is working fine, but I am having some trouble with creating the menu …

Get Year From Date string

I want to check whether the current year is greater than a date string(D-M-Y) here is my code $OldDate = “09-30-2011”; $OldYear = strtok($OldDate, ‘-‘); $NewYear = date(“Y”); if ($OldYear < $…

How to clone a gd resource in PHP

I’m looking for cloning an image in PHP created with imagecreatetruecolor or some other image creation function.. As it was said in the comment, no you can’t do a simple affection like : $copy = $…

Custom Fonts for DOMPDF

I’m Using DOM PDF 0.6.0 Beta 2. I want to use custom fonts (Fonts: ‘Segeo Print’, ‘Lucida Handwriting’,’Airplanes in the Night Sky’) in PDF file. I followed the guidelines to install and use fonts in my PHP Code, which is given here http://code.google.com/p/dompdf/wik…

PHP rename the keys of an array

How can I rename keys in an array? Start with this array named $start_array, and change the keys for ‘date’ and ‘revenue’ so you get this $final_array: Here is my terrible attempt which works but is messy. Answer Try the above code.

WooCommerce return product object by id

I am creating a custom theme for woocommerce and I need to be able to create a mini product display. I am having problems finding documentation on the woocommerce api. I have a comma delimited list of product IDs that I need to iterate through and display a custom mini product display for each in sequence. An…