php

PHP: array_map on object?

I'm trying to write a function that formats every (string) member/variable in an object, for example with a callback function. The variable names are unknown to me, so it must work with objects of all classes. How can I achieve something similar to array_map or array_walk with objects? ...

Setting up Subversion on a Red Hat system

I'm fairly new to the world of versioning but would like to introduce Subversion into our small development team as we're finding that more and more we are working on the same projects/files. We primarily code in PHP on a LAMP environment (Red Hat Enterprise). What I'm looking for are some starting points to get me up and running such a...

Simple web "live chat" software (LAMP stack) that integrates with Jabber/Aim

I've looked for this a few times in the past, to no avail. I would like a simple php/ajax web chat interface, that, and this is the critical part, will interface with my IM client (Pidgin) ... via Jabber or Aim. Plugoo is almost what I want, except it is hosted, and flash based. Flash-based would be OK if not ideal, but hosted isn't. N...

Send data between two PHP scripts

I want to have a PHP script send a XML formatted string to another PHP script that resides on a different server in a different part of town. Is there any nice, clean way of doing this? (PHP5 and all the latest software available) ...

How to get email and their attachments from PHP

I'm writing a photo gallery webapp for a friend's wedding and they want a photo gallery for guests to submit the digital photos they take on the day. After evaluating all the options, I've decided the easiest thing for users would be to let them use a familiar interface (their email) and just have them send in the pictures as attachmen...

PHP and MS Access

How can we connect a PHP script to MS Access (.mdb) file? I tried by including following PHP code: $db_path = $_SERVER['DOCUMENT_ROOT'] . '\WebUpdate\\' . $file_name . '.mdb'; $cfg_dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" . $db_path; $odbcconnect = odbc_connect($cfg_dsn, '', ''); But it failed and I received following er...

Table Sorting using CodeIgniter

Hi I've been developing a site over the past few weeks using CodeIgniter as the framework. It's a great framework, however I've been puzzling over the best way to accomplish something which in a lot of other frameworks / languages is relatively simple: sortable tables. CodeIgniter switches off query strings by default, because your URL...

How do I convert between time formats?

I am looking to convert a mysql timestamp to a epoch time in seconds using php, and vice versa. What's the cleanest way to do this? ...

Is there a free IDE for PHP on Mac?

I wanted to find a good but free PHP IDE for Mac. Any suggestions? Thanks! ...

Simplest PHP Routing framework .. ?

I'm looking for the simplest implementation of a routing framework in PHP, in a typical PHP environment (Running on Apache, or maybe nginx) .. It's the implementation itself I'm mostly interested in, and how you'd accomplish it. I'm thinking it should handle URL's, with the minimal rewriting possible, (is it really a good idea, to have...

In CakePHP, how can you determine if a field was changed in an edit action?

I'm using the cacheCounter in CakePHP, which increments a counter for related fields. Example, I have a Person table a Source table. Person.source_id maps to a row in the Source table. Each person has one Source, and each Source has none or many Person rows. cacheCounter is working great when I change the value of a source on a person....

What is the best IDE for PHP ?

I'm a PHP developer and now I use Notepad++ for code editing, but lately I've been searching for an IDE to ease my work. I've looked into Eclipse, Aptana and several others but I'm not really decided, they all look nice enough but a bit complicated. I'm sure it'll all get easy once I get used to it but I don't want to waste my time. Th...

cURL equivalent in JAVA

I am tasked with writing an authentication component for an open source JAVA app. We have an in-house authentication widget that uses https. I have some example php code that accesses the widget which uses cURL to handle the transfer. My question is whether or not there is a port of cURL to JAVA, or better yet, what base package wil...

Whats the best way to get total # of records in a mysql table with php?

Whats the most efficient way of selecting total number of records from a large table? Currently, Im simply doing $result = mysql_query("SELECT id FROM table"); $total = mysql_num_rows($result) I was told this was not very efficient or fast, if you have a lot of records in the table. ...

What is your preferred tool stack for PHP development in the Windows Environment?

I have been developing basic web sites for awhile now with some PHP thrown in for getting dynamic stuff done. However, I recently decided that it was time I got my hands a little dirtier so I wanted to start to play with the underpinnings of Wordpress and other such apps. I work on a Mac at home and have been using Coda for most of my ...

What is the standard format for documenting functions in php?

I've written a fair few php apps in the past, but tonight is my first foray into SVN so I figured I'd also document my code properly. What's the adopted format for documenting php functions? Obviously I could adopt my own format, but, looking forward, if there's one which can be used by documentation tools then all the better. Cheers! ...

How to check if a php script is still running

I have a PHP script that listens on a queue. Theoretically, it's never supposed to die. Is there something to check if it's still running? Something like Ruby's God ( http://god.rubyforge.org/ ) for PHP? God is language agnostic but it would be nice to have a solution that works on windows as well. ...

What's the best way to use SVN to version control a PHP site?

I've always just FTPed files down from sites, edited them and put them back up when creating sites, but feel it's worth learning to do things properly. I've just commited everything to a SVN repo, and have tried sshing into the server and checking out a tagged build, as well as updating that build using switch. All good, but it's a lot...

Can't download file in IE7 but there isn't any problem in Firefox, Chrome, etc..?

I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this: $MimeType = new MimeType(); $mimetype = $MimeType->getType($filename); $basename = basename($filename); header("Content-type: $mimetype"); header("Content-Disposition: attachment; filename=\"$basename\""); heade...

Which PHP framework is closest to Ruby on Rails? CakePHP? CodeIgniter?

I'm going to be switching back and forth between Ruby on Rails projects and some as-of-yet undecided PHP MVC framework projects. Which of the PHP MVC frameworks out there (CakePHP, CodeIgniter?, others?) is most similar to Ruby on Rails in that the most conventions, locations, workflows, etc are preserved? I'm looking for the similar...