I am using a Windows XP Home Edition. I need to install a few extensions to PHP -- memcache, APC, .etc. And I would very much like to use PECL to make this happen. The problem is PECL takes it for granted that I will have certain programs on my computer. On another post, I read, for instance, that you need to have Microsoft Visual Studio...
When you do the following in an HTML form:
<input name="one[]" value="foo" />
<input name="one[]" value="bar" />
<input name="two[key]" value="something" />
and submit the form to a PHP page, The $_POST array will look as follows:
array(
'one' => array(
0 => 'foo',
1 => 'bar'
),
'two' => array(
'ke...
Anyone know of an opensource PHP Load Testing Framework similar to the Grinder " "http://grinder.sourceforge.net/".
...
Is there a simple way to sort an iterator in PHP (without just pulling it all into an array and sorting that).
The specific example I have is a DirectoryIterator but it would be nice to have a solution general to any iterator.
$dir = new DirectoryIterator('.');
foreach ($dir as $file)
echo $file->getFilename();
I'd like to be abl...
When I try to use curl or file_get_contents to read something like http://example.com/python/json/ from http://example.com/ I should be getting a JSON response, but instead I get a 404 error. Using curl or any other method outside my own domain works perfectly well.
echo file_get_contents('http://example.com/python/json/'); => 404
echo ...
Is there a way to dynamically invoke a method in the same class for PHP? I don't have the syntax right, but I'm looking to do something similar to this:
$this->{$methodName}($arg1, $arg2, $arg3);
...
PHP (among others) will execute the deepest function first, working its way out. For example,
$text = strtoupper(str_replace('_', ' ', file_get_contents('file.txt')));
I'm doing something very similar to the above example for a template parser. It looks for the tags
{@tag_name}
and replaces it with a variable of the name $tag_name....
Does anybody knows how can I get the max and min value of the 2nd and 3rd columns in PHP?
$ar = array(array(1, 10, 9.0, 'HELLO'),
array(1, 11, 12.9, 'HELLO'),
array(3, 12, 10.9, 'HELLO'));
Output should be like:
max(12.9)
min(10)
Thanks in advance
...
I'm using symfony and propel, and I'm trying to invoke a specific culture on an object and output some fields of that object to the screen in that specific culture. However, if the object's mapped database record doesn't have those fields in that specific culture, I would like it to default to the base culture (in this case, en_US)
I'm ...
What is the best way to check if a given url points to a valid file (i.e. not return a 404/301/etc.)? I've got a script that will load certain .js files on a page, but I need a way to verify each URL it receives points to a valid file.
I'm still poking around the PHP manual to see which file functions (if any) will actually work with re...
Hi,
I've just made a survey form, and I can't quite figure out how to get the body to come up on the email, does anyone know what I've done wrong?
<?php
require_once "Mail.php";
//send to and whats it called\\
$recipient = '[email protected]';
$subject = ' Completed Survey';
$from = "Mail House <[email protected]>";
$to = "A <x@...
I have got the following problem since the server has safe mode turned on, and directories are being created under different users:
I upload my script to the server, it shows as belonging to 'user1'. All it is doing is making a new directory when a new user is created so it can store files in it.
New directory is created, but it belong...
I have two PHP scripts, both using the same session by calling session_name('MySessID').
When the first script calls the second script using curl, the second script hangs when session_start() is called.
Why would this happend?
...
Magento shopping cart is built on the Zend Framework in PHP. This is the first time I've dealt with the Zend framework and I'm having the following difficulty...
I'm creating a custom module that will allow users to upload images whenever they purchase products.
I can overload the addAction() method whenever a user attempts to add a p...
I am generating the json from PHP.
...
Hello, I am new to PHP and trying to get the following code to work:
<?php
include 'config.php';
include 'opendb.php';
$query = "SELECT name, subject, message FROM contact";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name :{$row['name']} <br>" .
"Subject : {$row['subject']...
Hello,
I am trying the following code:
<?php
$link = mysql_connect('localhost', 'root', 'geheim');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
$query = "SELECT * FROM Auctions";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, ...
Hello,
I have the following code:
<?php
$link = mysql_connect('localhost', 'root', 'geheim');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db(ebay);
$query = "SELECT * FROM Auctions";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array(...
Hi everyone,
I'm a web developer. I use opensource primarily PHP and mySQL for developing my websites, and use drupal and cakephp to shortcut the development time.
Us web developers especially in such "low wage" places like South East Asia like to learn on our own (of course since it's free) or if get certified, for proprietary system...
hello,
i have this code.
<?php
$link = mysql_connect('localhost', 'root', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db("ebay");
$query = "SELECT * FROM Auctions";
$result = mysql_query($query) or die(mysql_error());
$records = array();
while($row = ...