php

Trouble understanding Firephp

I don't get FirePhp FirePhp is an extension for the Firefox add-on Firebug. I don't get why this should be used at all. How can this tool give me more than your everyday PHP debugger? Seriously? I don't understand how to implement this, can someone please explain... video with narration perhaps? ...

ASP.NET server and PHP?

I wanted to know, is a server that supports ASP.NET and PHP on the same box common? wordpress/mediaWiki/phpBB3 seem like a nice combo but i am developing a ASP.NET project. ...

Determining what classes are defined in a PHP Class file

Given that each php file in our project contains a single class definition... any suggestions for determining what class was defined within the file? I know I could just regex the file for class statements, but I'd prefer to do something that's more efficient. Suggestions? Thanks ...

PHP Uploading Issue

Hi there. I've worked with a few scripts to begin uploading files on my development machine. Problem is, despite the expected ease of this operation, Apache seems to time-out whenever I try to upload an image. Uploading is set to On and the tmp directory is set in php.ini. I tried uploading the main gif from Google, an 8.36KB image. I...

Alternating Capital Letters in Array Using PHP

I have an alphanumeric string like below, $string_1 = "a4nas60dj71wiena15sdl1131kg12b" and would like to change it to something like below, $string_2 = "a4NaS60dJ71wIeNa15Sdl1131Kg12B" How would I go about doing this? I have tried the below code, but it doesn't work. $lenght = strlen($string_1); for ( $i = 0; $i <= $length - 1; ...

Getting 'invalid argument for foreach' for a valid array in PHP

I'm getting the error Invalid argument supplied for foreach() even though the array being supplied appears to be a valid array. Here's my code: print_r($keywords); extract($product); foreach ($keywords as $k=>$v) { //stuff here } Here's some of the output from the print_r: Array ( [0] => Array ( [text] => v...

Is there an easy way to get AuthComponent user data from a view in CakePHP?

According to the cakebook section on the Auth component, I can implement simple authentication by using the following Users controller: class UsersController extends AppController { var $name = 'Users'; var $components = array('Auth'); // Not necessary if declared in your app controller /** * The AuthComponent pr...

cannot ffmpeg-php mac os x leopard

has anyone been able to install ffmpeg-php on osx? i was able to install ffmpeg via mac ports. ffmpeg-php wont install. problems: cannot find shared directory because macports installs it to /opt/local/include/ and /opt/local/lib. ffmpeg-php looks in /usr/local/include/ffmpeg phpize returns a whole bunch of warnings, not sure if thi...

How do I flatten an associative array into an array with only values in PHP?

I have an array that has keys and values. For eg: Array ( [name] => aalaap [age] => 29 [location] => mumbai ) I want to convert the keys from this into values, but I want the values to apear right after the keys. For eg: Array ( [0] => name [1] => aalaap [2] => age [3] => 29 [4] => location [5] => ...

Easiest way to convert a PHP page to static HTML page

I want to convert a web pages which is heavily CSS styled is written in PHP to static html so that I can embed it in an email. I have managed to do this but for achieving this I had to convert the whole page into a string and then assign that string as email body. The layout of the page does not look as good as original as I have not be...

Can spawned Postgresql process be controlled by the spawner PHP script?

I have a PHP CLI script, that processes a csv file, inserting it's content to a table in Postgresql database. This is on an Ubuntu server. I use schedtool to control the affinity of the whole script. Schedtool is used to launch the script itself with the -e option. Unfortunately with htop I see that the database thread is spawned as a co...

Bag of words model: 2 PHP functions, same results: Why?

Hello! I have two PHP functions to calculate the relation between two texts. They both use the bag of words model but check2() is much faster. Anyway, both functions give the same results. Why? check1() uses one big dictionary array containing ALL words - as described in the bag of words model. check2() doesn't use one big array but an ...

What development notepad should I use?

I need recommendations for a good (free) development notepad to work in on my new macbook, mainly for PHP, AJAX etc. ...

How to enable the PDO driver for sqlite3 in php?

Goodeve, My SQLite is version 3.4.0 However my phpinfo's PDO support for SQLitev3 is not enabled/listed How can I enable it? I installed my web server via XAMPP. ...

How can I compile C/C++ code in PHP on the Windows platform?

Can anyone help me with the compilation of C++ code in PHP on the Windows platform? I am using Microsoft Visual C++ 6.0. I have tried the following options which I knew, but none of them work: system('test.c') exec('test.c') The file 'test.c' has been placed in my php/www/ folder. I need to first compile the code, which makes test....

Best PHP Framework for someone who has never used one?

Looking into using frameworks for some personal PHP apps - the only one I have ever vaguely used us codeigniter, are the any better well documented frameworks available? ...

[Doctrine] Can fixtures "copy" items from other fixtures?

In my ACL fixtures I have resources and actions, most of the resources share common actions like CRUD, is there a way in Doctrine (yaml) to extend another element? Here is a blurb from my current yaml: Resource: R1: title: Article system_name: ARTICLE Actions: A1: title: Create system_nam...

Get size of uncompressed data in zlib?

I'm creating something that includes a file upload service of sorts, and I need to store data compressed with zlib's compress() function. I send it across the internet already compressed, but I need to know the uncompressed file size on the remote server. Is there any way I can figure out this information without uncompress()ing the data...

How can I fix this PHP XML parsing error?

This is my first question :). Im writing a little twitter app in PHP that sends a DMs to all your followers. What im trying to do right now is to get the list of followers. So through twitter api and getting all usernames but for some reason this parsing error appear. Im new to php(but not so much to programming), I actually started lea...

High-traffic percentage-based set picks?

The setup: High traffic website and a list of image URLs that we want to display. We have one image spot, and each item in the set of image URLs has a target display percentage for the day. Example: Image1 - 10% Image2 - 30% Image3 - 60% Because the traffic amount can vary from day to day, I'm doing the percentages within blocks of 1...