php

How can I initialize Zend_Form_Element_Select with a config array?

I tried: $form->addElement( 'select', 'salutation', array( 'required' => true, 'options' => array( 'Mr.' => 'Mr.', 'Mrs.' => 'Mrs.', ...

What are some good study resources for the Zend PHP certification?

I'm preparing to take the Zend PHP exam and want to find some resources for study materials. I already have php|Architect's Zend PHP 5 study guide, and of course there is the documentation at the PHP site itself. I'd particularly be interested in FREE practice tests or first-hand advice from others who have taken the exam as to what to...

Your attitude to Haml?

I'm considering Haml as a templating engine to use with PHP (via phammable). Do you know any potential drawbacks to using it? Googling seems to glorify it too much, all that markup haiku thing. ...

CakePHP View including other views

Heyall, I have a CakePHP application that in some moment will show a view with product media (pictures or videos) I want to know if, there is someway to include another view that threats the video or threats the pictures, depending on a flag. I want to use those "small views" to several other purposes, so It should be "like" a cake comp...

Are there many users of PRADO out there?

After making some comments, I've been inspired to get some feedback on the PHP MVC framework PRADO. I've been using it for over a year now and I've very much enjoyed working with it, however I notice that throughout Stack Overflow, it doesn't seem to rate a mention when symfony or CakePHP are being talked about as potential candidates fo...

What are the bare basics you put down when you start a new PHP project?

I personally use the following method for all my sites. It has grown a little bit from using prefixed $_GET variables to using mod__rewrite but i have had these basics for a couple of years now. .htaccess: RewriteEngine On RewriteRule ^includes/ - [L] [OR] #do not apply for direct requests to /includes or RewriteRule ^images/ - [L] ...

Deploying to multiple servers

I have to deploy my php/html/css/etc code to multiple servers and i am looking at my options for software that allows easy and secure deployment to multiple servers. Also helps if it could be tied into my SVN. Any suggestions? ...

What's the most current, good practice, and easiest way to use sessions in PHP?

Sessions in PHP seemed to have changed since the last time I used them, so I'm looking for a simple way of using sessions but at the same time for it to be relatively secure and a good common practice. ...

How do I sort a multidimensional array in php

I have CSV data loaded into a multidimensional array. In this way each "row" is a record and each "column" contains the same type of data. I am using the function below to load my CSV file. function f_parse_csv($file, $longest, $delimiter) { $mdarray = array(); $file = fopen($file, "r"); while ($line = fgetcsv($file, $longe...

How can I get word wrap to work in Eclipse PDT for PHP files?

Programming PHP in Eclipse PDT is predominately a joy: code completion, templates, method jumping, etc. However, one thing that drives me crazy is that I can't get my lines in PHP files to word wrap so on long lines I'm typing out indefinitely to the right. I click on Windows|Preferences and type in "wrap" and get: Java | Code Style ...

How to secure database passwords in PHP?

Hi all, When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way to secure that password? It seems like just writing it in the PHP cod...

Which PHP open source CRM should I use?

What PHP based open source CRM is best to use for a small scale company? ...

How do I parse a PHP serialized datastructure in Java?

I have a system that combines the best and worst of Java and PHP. I am trying to migrate a component that was once written in PHP into a Java One. Does anyone have some tips for how I can parse a PHP serialized datastructure in Java? By serialized I mean output from php's serialize function. ...

PHP Associative arrays to and from XML

Is there an easy way to marshal a PHP associative array to and from XML? For example, if I have the following array: $items = array("1", "2", array( "item3.1" => "3.1", "item3.2" => "3.2" "isawesome" => true ) ); How would I turn it into something similar to the following XML in as few lines as possible...

What is a good PHP library to handle file uploads?

I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library? Edit: I am aware that file uploads are built into PHP, I am looking for a library that may make the process simpler and safer. ...

Convert/extract phpinfo() into php.ini

I am thinking along the lines of replicating a web hosts PHP setup environment for offline local development. The idea is to parse the output of phpinfo() and write any setup values it contains into a local php.ini. I would imagine everything ism included in phpinfo and that certain things would only be specific to the environment it is...

Facebook RSS application

How can I make a Facebook RSS application that autoupdates from the provided RSS feeds. Of course doing this is trivial for canvas applications, but I need this for showing on the Facebook Page. All the RSS apps I've taken a look at either dont update or dont work on Facebook Pages. Especially now that infinite session keys are deprec...

Disable Cakephp's Auto Model "feature"

In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now I'm experiencing the bad side of this. I've created a plu...

How do I unit-test inheriting objects?

When you use composition, then you can mock the other objects from which your class-under-test depends, but when you use inheritance, you can't mock the base class. (Or can you?) I generally try to prefer composition over inheritance, but sometimes inheritance really seems like the best tool for the job - well, at least until it comes t...

Receiving multipart POST data requests in PHP

I want to receive the following HTTP request in PHP: Content-type: multipart/form-data;boundary=main_boundary --main_boundary Content-type: text/xml <?xml version='1.0'?> <content> Some content goes here </content> --main_boundary Content-type: multipart/mixed;boundary=sub_boundary --sub_boundary Content-type: application/octet-s...