php-general Digest 11 Aug 2010 10:27:20 -0000 Issue 6888
Topics (messages 307390 through 307396):
Variable variables into an array.
307390 by: Richard Quadling
307392 by: Jim Lucas
307393 by: Richard Quadling
307394 by: Andrew Ballard
307396 by: Richard Quadling
/status page of php-fpm 5.3.3
307391 by: Martin Minka
Mail_Mime: undefined method Mail_mimePart::encodeHeader()
307395 by: René Santis
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
<?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?>
The output is an empty array.
Examining $GLOBALS, I end up with an entries ...
[Set] => Array
(
)
[Entry] => Set[1]
[Value] => Assigned
[Set[1]] => Assigned
According to http://docs.php.net/manual/en/language.variables.basics.php,
a variable named Set[1] is not a valid variable name. The [ and ] are
not part of the set of valid characters.
In testing all the working V4 and V5 releases I have, the output is
always an empty array, so it looks like it is me, but the invalid
variable name is an issue I think.
Regards,
Richard.
NOTE: The above is a simple test. I'm trying to map in nested data to
over 10 levels.
--
Richard Quadling.
--- End Message ---
--- Begin Message ---
Richard Quadling wrote:
Hi.
Quick set of eyes needed to see what I've done wrong...
The following is a reduced example ...
<?php
$Set = array();
$Entry = 'Set[1]';
$Value = 'Assigned';
$$Entry = $Value;
print_r($Set);
?>
The output is an empty array.
Examining $GLOBALS, I end up with an entries ...
[Set] => Array
(
)
[Entry] => Set[1]
[Value] => Assigned
[Set[1]] => Assigned
According to http://docs.php.net/manual/en/language.variables.basics.php,
a variable named Set[1] is not a valid variable name. The [ and ] are
not part of the set of valid characters.
In testing all the working V4 and V5 releases I have, the output is
always an empty array, so it looks like it is me, but the invalid
variable name is an issue I think.
Regards,
Richard.
NOTE: The above is a simple test. I'm trying to map in nested data to
over 10 levels.
For something like this, a string that looks like a nested array
reference, you might need to involve eval for it to "derive" that nested
array.
--- End Message ---
--- Begin Message ---
On 10 August 2010 16:49, Jim Lucas <[email protected]> wrote:
> Richard Quadling wrote:
>>
>> Hi.
>>
>> Quick set of eyes needed to see what I've done wrong...
>>
>> The following is a reduced example ...
>>
>> <?php
>> $Set = array();
>> $Entry = 'Set[1]';
>> $Value = 'Assigned';
>> $$Entry = $Value;
>> print_r($Set);
>> ?>
>>
>> The output is an empty array.
>>
>> Examining $GLOBALS, I end up with an entries ...
>>
>> [Set] => Array
>> (
>> )
>>
>> [Entry] => Set[1]
>> [Value] => Assigned
>> [Set[1]] => Assigned
>>
>>
>> According to http://docs.php.net/manual/en/language.variables.basics.php,
>> a variable named Set[1] is not a valid variable name. The [ and ] are
>> not part of the set of valid characters.
>>
>> In testing all the working V4 and V5 releases I have, the output is
>> always an empty array, so it looks like it is me, but the invalid
>> variable name is an issue I think.
>>
>> Regards,
>>
>> Richard.
>>
>> NOTE: The above is a simple test. I'm trying to map in nested data to
>> over 10 levels.
>
> For something like this, a string that looks like a nested array reference,
> you might need to involve eval for it to "derive" that nested array.
>
I'm happy with that.
It seems variable variables can produce variables that do not follow
the same naming limitations as normal variables.
--
Richard Quadling.
--- End Message ---
--- Begin Message ---
On Tue, Aug 10, 2010 at 12:23 PM, Richard Quadling <[email protected]> wrote:
> On 10 August 2010 16:49, Jim Lucas <[email protected]> wrote:
>> Richard Quadling wrote:
>>>
>>> Hi.
>>>
>>> Quick set of eyes needed to see what I've done wrong...
>>>
>>> The following is a reduced example ...
>>>
>>> <?php
>>> $Set = array();
>>> $Entry = 'Set[1]';
>>> $Value = 'Assigned';
>>> $$Entry = $Value;
>>> print_r($Set);
>>> ?>
>>>
>>> The output is an empty array.
>>>
>>> Examining $GLOBALS, I end up with an entries ...
>>>
>>> [Set] => Array
>>> (
>>> )
>>>
>>> [Entry] => Set[1]
>>> [Value] => Assigned
>>> [Set[1]] => Assigned
>>>
>>>
>>> According to http://docs.php.net/manual/en/language.variables.basics.php,
>>> a variable named Set[1] is not a valid variable name. The [ and ] are
>>> not part of the set of valid characters.
>>>
>>> In testing all the working V4 and V5 releases I have, the output is
>>> always an empty array, so it looks like it is me, but the invalid
>>> variable name is an issue I think.
>>>
>>> Regards,
>>>
>>> Richard.
>>>
>>> NOTE: The above is a simple test. I'm trying to map in nested data to
>>> over 10 levels.
>>
>> For something like this, a string that looks like a nested array reference,
>> you might need to involve eval for it to "derive" that nested array.
>>
>
> I'm happy with that.
>
> It seems variable variables can produce variables that do not follow
> the same naming limitations as normal variables.
>
It would seem so. If eval() works, can you rearrange the strings a
little to make use of parse_str() and avoid the use of eval()?
Andrew
--- End Message ---
--- Begin Message ---
On 10 August 2010 18:08, Andrew Ballard <[email protected]> wrote:
> On Tue, Aug 10, 2010 at 12:23 PM, Richard Quadling <[email protected]>
> wrote:
>> On 10 August 2010 16:49, Jim Lucas <[email protected]> wrote:
>>> Richard Quadling wrote:
>>>>
>>>> Hi.
>>>>
>>>> Quick set of eyes needed to see what I've done wrong...
>>>>
>>>> The following is a reduced example ...
>>>>
>>>> <?php
>>>> $Set = array();
>>>> $Entry = 'Set[1]';
>>>> $Value = 'Assigned';
>>>> $$Entry = $Value;
>>>> print_r($Set);
>>>> ?>
>>>>
>>>> The output is an empty array.
>>>>
>>>> Examining $GLOBALS, I end up with an entries ...
>>>>
>>>> [Set] => Array
>>>> (
>>>> )
>>>>
>>>> [Entry] => Set[1]
>>>> [Value] => Assigned
>>>> [Set[1]] => Assigned
>>>>
>>>>
>>>> According to http://docs.php.net/manual/en/language.variables.basics.php,
>>>> a variable named Set[1] is not a valid variable name. The [ and ] are
>>>> not part of the set of valid characters.
>>>>
>>>> In testing all the working V4 and V5 releases I have, the output is
>>>> always an empty array, so it looks like it is me, but the invalid
>>>> variable name is an issue I think.
>>>>
>>>> Regards,
>>>>
>>>> Richard.
>>>>
>>>> NOTE: The above is a simple test. I'm trying to map in nested data to
>>>> over 10 levels.
>>>
>>> For something like this, a string that looks like a nested array reference,
>>> you might need to involve eval for it to "derive" that nested array.
>>>
>>
>> I'm happy with that.
>>
>> It seems variable variables can produce variables that do not follow
>> the same naming limitations as normal variables.
>>
>
> It would seem so. If eval() works, can you rearrange the strings a
> little to make use of parse_str() and avoid the use of eval()?
>
> Andrew
>
php -r "parse_str('a[1][2][3]=richard quadling'); var_dump($a);"
outputs ...
array(1) {
[1]=>
array(1) {
[2]=>
array(1) {
[3]=>
string(16) "richard quadling"
}
}
}
Perfect.
Thanks.
--
Richard Quadling.
--- End Message ---
--- Begin Message ---
Hello,
I am using PHP 5.3.3 compiled as PHP-FPM.
My Apache is using mod_fastcgi to connect to PHP-FPM and everything works as
expected.
Unfortunately I don't know how to forward request http://localhost/status to
PHP-FPM so that I will see the status page of PHP-FPM.
I found only NGINX configuration
http://forum.nginx.org/read.php?3,56426,56578.
Could you pls. help me to fix this configuration ?
FastCgiExternalServer /opt/php-5.3.3/bin/www -socket /dev/shm/fpm-www.socket
-idle-timeout 900
ScriptAlias /php-bin/ /opt/php-5.3.3/bin/
<Directory /var/www>
<IfModule mod_fastcgi.c>
<FilesMatch \.php$>
SetHandler php-fastcgi
Action php-fastcgi /php-bin/www
</FilesMatch>
</IfModule>
</Directory>
I was trying something like:
<Location /status>
SetHandler php-fastcgi
Action php-fastcgi /php-bin/www
</Location>
--- End Message ---
--- Begin Message ---
Hello everyone.
I'm developing a mailing list manager, using the package Mail_Mime.
Everything works fine, but when I try sending an e-mail get the following
error:
Fatal error: Call to undefined method Mail_mimePart:: encodeHeader () in /
home / devised / php / Mail / mime.php on line 1316
I don't know if it's a bug or error in my own code, I don't think it's so,
because the error comes from the library mime.php and I dare not to modify
the code.
I hope and give me a quick solution. Thank you.
--- End Message ---