php-general Digest 25 Apr 2008 14:29:21 -0000 Issue 5424
Topics (messages 273552 through 273560):
Re: putting variables in a variable
273552 by: Yannick Warnier
reading Qmail boxes
273553 by: Richard Kurth
273555 by: Per Jessen
Re: Big companies that use PHP?
273554 by: Iñigo Medina García
Re: mbstring vs iconv - Any existing benchmark?
273556 by: Per Jessen
foreach loop to set variables
273557 by: jamest
273558 by: Stut
273559 by: Jason Norwood-Young
273560 by: Casey
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 ---
Le lundi 28 mars 2011 à 12:06 +0100, Hulf a écrit :
> Hi,
>
> I am making and HTML email. I have 3 images to put in. Currently I have
>
> $body .="
> <table>
> <tr>
> <td><img src=\"image1.jpg\"></td>
> </tr>
>
> <tr>
> <td></td>
> </tr>
> </table>
> ";
>
>
> ideally I would like to have
>
> $myimage1 = "image1.jpg";
> $myimage2 = "image2.jpg";
> $myimage3 = "image3.jpg";
>
>
> and put them into the HTML body variable. I have tried escaping them in
> every way i can think of, dots and slashes and the rest. Any ideas?
The question is not very clear to me, but doesn't the following give
what you are trying to get?
$myimage1 = "image1.jpg";
$body .="
<table>
<tr>
<td><img src=\"$myimage1\"></td>
</tr>
<tr>
<td></td>
</tr>
</table>
";
Otherwise, could you explain your intentions in another way?
Yannick
--- End Message ---
--- Begin Message ---
I what to read the email headers that are in a Qmail mailbox so that I
can run it threw a filter and see what mail bounced for what reason.
How do I do this being that the ownership on Qmail mailboxes are
diferent from the owner that runs php and apache
--- End Message ---
--- Begin Message ---
Richard Kurth wrote:
> I what to read the email headers that are in a Qmail mailbox so that I
> can run it threw a filter and see what mail bounced for what reason.
> How do I do this being that the ownership on Qmail mailboxes are
> diferent from the owner that runs php and apache
Don't run your script under apache, but with an appropriate userid in
cli mode. If you need the results presented by apache, maybe think of
using suexec().
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
> Actually I was at FISL (Free Software International Forum) last week and
> Rasmus was there.
>
> He was talking about Large Scale PHP (fair enough, huh?) and he said he
> still works for Yahoo, it's been 6 years now.
>
> There's a link for his talk: http://talks.php.net/show/fisl08
>
>
> That just rang a bell: Rasmus+Yahoo+M$ != PHP?
>
>
> I did not know Google used it, does anyone have any proof of that? I know
> they make extense use of python, but not sure about PHP.
Nop, Thiago. My mistake: We spoke about Rasmus but my memory was with
Guido (python). :-(
Sorry and thanks for the link.
Iñigo
> -----Mensagem original-----
> De: Iñigo Medina García [mailto:[EMAIL PROTECTED]
> Enviada em: quinta-feira, 24 de abril de 2008 04:37
> Cc: [EMAIL PROTECTED]
> Assunto: Re: [PHP] Big companies that use PHP?
>
> Warren Vail wrote:
>> How about Yahoo and Google, extensively, in fact, I believe Rasmus Lerdorf
>> is still on staff at Yahoo, unless it's Micro Hoo by now ;-).
>
> :-) I think he is in fact at Google.
>
> Iñigo
>
>
>> Warren
>>
>>> -----Original Message-----
>>> From: Nathan Nobbe [mailto:[EMAIL PROTECTED]
>>> Sent: Wednesday, April 23, 2008 1:50 PM
>>> To: Thiago Pojda
>>> Cc: [EMAIL PROTECTED]
>>> Subject: Re: [PHP] Big companies that use PHP?
>>>
>>> On Wed, Apr 23, 2008 at 2:26 PM, Thiago Pojda <
>>> [EMAIL PROTECTED]> wrote:
>>>
>>>> Thanks everyone for replying, I think those names can
>>> change someone's
>>>> mind
>>>> ;)
>>> i know where youre coming from; i recall a certain manager
>>> once saying to me 'php doesnt scale when it goes OO'. i
>>> wanted to take his head off, but instead i mentioned wikipedia.
>>>
>>> -nathan
>>>
>>
>
>
--
--------
Iñigo Medina García
Librería Díaz de Santos Madrid (Spain)
[EMAIL PROTECTED] [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Yannick Warnier wrote:
> The basic functions offered by both extensions seem to be providing
> *about* the same features, and I read a ppt presentation from Carlos
> Hoyos [1] just saying this:
>
> "
> PHP supports multi byte in two extensions: iconv and mbstring
> * iconv uses an external library (supports more encodings but less
> portable)
> * mbstring has the library bundled with PHP (less encodings but more
> portable)
> "
>
> Is this really all there is to having two extensions providing
> character encoding features?
More or less, yes.
> Is there any kind of strong difference in efficiency?
I doubt it. It's not exactly a complicated function.
> It's out of curiosity, so not urgent, but I'd like to be sure I do the
> right choice next time around.
Personally I use iconv, in PHP and elsewhere. I think it is most likely
seeing a lot more use, and the socalled lack of portability is of zero
concern to me.
/Per Jessen, Zürich
--- End Message ---
--- Begin Message ---
I am passing an array to a class which I want to take the array data and
create some variables from the array's keys and values.
So I want to create (in this case 21) new variables that I want to create in
the foreach but with no success.
foreach ($formdata as $key => $value) {
echo "$key = $value";
}
This echo's all the data how I would expect. But taking the echo out to
have:
foreach ($formdata as $key => $value) {
$key = $value;
}
But this doesn't work. The variables aren't set.
I was thinking that I could set up the variables outside of the function by
using public $variablename for all the different variables then set the
variable value using:
foreach ($formdata as $key => $value) {
$this->key = $value;
}
But that didn't work either.
--
View this message in context:
http://www.nabble.com/foreach-loop-to-set-variables-tp16895552p16895552.html
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---
--- Begin Message ---
On 25 Apr 2008, at 14:12, jamest wrote:
I am passing an array to a class which I want to take the array data
and
create some variables from the array's keys and values.
So I want to create (in this case 21) new variables that I want to
create in
the foreach but with no success.
foreach ($formdata as $key => $value) {
$key = $value;
}
$$key = $value;
They're called variable variables - search the manual for that term
for more info.
But this doesn't work. The variables aren't set.
I was thinking that I could set up the variables outside of the
function by
using public $variablename for all the different variables then set
the
variable value using:
foreach ($formdata as $key => $value) {
$this->key = $value;
}
$this->$key = $value;
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Fri, 2008-04-25 at 06:12 -0700, jamest wrote:
> I am passing an array to a class which I want to take the array data and
> create some variables from the array's keys and values.
>
> So I want to create (in this case 21) new variables that I want to create in
> the foreach but with no success.
>
> foreach ($formdata as $key => $value) {
> echo "$key = $value";
> }
>
> This echo's all the data how I would expect. But taking the echo out to
> have:
>
> foreach ($formdata as $key => $value) {
> $key = $value;
> }
>
> But this doesn't work. The variables aren't set.
>
> I was thinking that I could set up the variables outside of the function by
> using public $variablename for all the different variables then set the
> variable value using:
>
> foreach ($formdata as $key => $value) {
> $this->key = $value;
> }
How about $this->formdata?
--- End Message ---
--- Begin Message ---
On Apr 25, 2008, at 6:12 AM, jamest <[EMAIL PROTECTED]> wrote:
I am passing an array to a class which I want to take the array data
and
create some variables from the array's keys and values.
So I want to create (in this case 21) new variables that I want to
create in
the foreach but with no success.
foreach ($formdata as $key => $value) {
echo "$key = $value";
}
This echo's all the data how I would expect. But taking the echo
out to
have:
foreach ($formdata as $key => $value) {
$key = $value;
}
But this doesn't work. The variables aren't set.
I was thinking that I could set up the variables outside of the
function by
using public $variablename for all the different variables then set
the
variable value using:
foreach ($formdata as $key => $value) {
$this->key = $value;
}
But that didn't work either.
--
View this message in context:
http://www.nabble.com/foreach-loop-to-set-variables-tp16895552p16895552.html
Sent from the PHP - General mailing list archive at Nabble.com.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
foreach ($formdata as $key => $value)
$formdata[$key] = $value;
--- End Message ---