RabbitMQ and Yii console callback error

I am trying to get RabbitMQ working with the Yii console in order to send transactional emails, but I am experiencing problems with getting the PHP-AMQPLib library to work within Yii. My code is …

PHP/MySQL web-app Internationalization with enum DB fields

I have joined a project recently and now I’m working on its Internationalization improvement. Technologies used are PHP/MySQL/Zend Framework/Dojo. I18n is implemented using gettext almost as described …

php/curl – get extension of image on remote server using headers

There is a form on my website that allows the upload of images from a remote server. When the user enters the link and submits, I want to check the file and make sure it’s the right extension before I …

PHP PDO Firebird inserting

I’m new in Firebird but I’d like to write a small script in PHP that reads a CSV file and fills an existing Firebird db with its data. The problem is I don’t really know how to use the autoincrement …

How to get selected month in jQuery full calendar?

We are using jQuery full calendar for displaying events from database. I need to display the events below the calendar according to user selected month onchange. I can get data according to event …

PHP convert XML to JSON

I am trying to convert xml to json in php. If I do a simple convert using simple xml and json_encode none of the attributes in the xml show. $xml = simplexml_load_file(“states.xml”); echo json_encode(…

Using smarty variable within {php} tags

Very simple question, is it possible to use a smarty var inside the {php}{/php} tags. I know it’s deprecated, pointless, not recommended, etc., but please, I am looking for a simple patch ! Something …

Test if a regular expression is a valid one in PHP

I am writing a form validation class and wish to include regular expressions in the validation. Therefore, the regex provided isn’t guaranteed to be valid. How can I (efficiently) check that the …

PHP: Append to thrown exception message

Take the following function as an example of what I want to do: public function save() { $this->connect(‘wb’); try { if(!$this->lock()) throw new Exception(“Unable …

iconv – Detected an illegal character in input string

I don’t see anything illegal – any suggestions on what might be the problem? if (strtolower($matches[1]) != ‘utf-8’) { var_dump($matches[1]); $xml = iconv($matches[1], ‘utf-8’, $…