, October 22, 2009 2:25 AM
To: a...@ashleysheridan.co.uk
Cc: David Murphy; php-general@lists.php.net
Subject: Re: [PHP] how call a variable in a text
Ashley Sheridan wrote on 2009-10-21 22:43:
The {} only become really useful when you're trying to reference arrays
within a string:
$var = array
On Wed, 2009-10-21 at 23:11 +0200, Kim Madsen wrote:
Ashley Sheridan wrote on 2009-10-21 22:56:
Try this though:
?php
$var = array(array('great','alright'), 'boring');
print This is $var[0][0].;
Print This is different from your previous example :-);
--
Kind regards
Kim
On Thu, 2009-10-22 at 09:53 +0300, Thodoris wrote:
On Wed, 2009-10-21 at 23:11 +0200, Kim Madsen wrote:
Ashley Sheridan wrote on 2009-10-21 22:56:
Try this though:
?php
$var = array(array('great','alright'), 'boring');
print This is $var[0][0].;
Print
: Kim Madsen [mailto:php@emax.dk]
Sent: Thursday, October 22, 2009 2:25 AM
To: a...@ashleysheridan.co.uk
Cc: David Murphy; php-general@lists.php.net
Subject: Re: [PHP] how call a variable in a text
Ashley Sheridan wrote on 2009-10-21 22:43:
The {} only become really useful when you're
Erm, the braces are meant to go *around* the variable, not around a
bit of it:
print Test: {$var[0][0]};
Thanks,
Ash
http://www.ashleysheridan.co.uk
In many cases braces can go around the variable name not the necessarily
around the whole variable (like the bash scripts). Those are
Erm, the braces are meant to go *around* the variable, not around a bit
of it:
print Test: {$var[0][0]};
unrelated, just another usage of curly brackets
$_ = 'abc';
$i = 0;
echo $_{++$i}; // b
Regards
So no they are not meant to go around. You can use them this way as well.
that has almost the same meaning of
$_ = '_POST';
echo count($$_);
which again, for readability brackets are suggested to improve maintainability
$_ = '_POST';
echo count(${$_});
Regards
So no they are not meant to go around. You can use them this way as
well.
that has almost the same meaning of
$_ = '_POST';
echo count($$_);
which again, for readability brackets are suggested to improve
maintainability
$_ = '_POST';
echo count(${$_});
Regards
Using the same type way as before in this thread.
This was supposed to come out as using the same way of thinking.
But the English-Nerdish dictionary came out...
--
Thodoris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I don't think it is about readability:
$arr[3] = 'test';
$test = 3;
//This prints $test
echo This doesn't work: $$arr[3];
//This prints 3
echo This works: ${$arr[3]};
Using the same type way as before in this thread.
Above example is a classic one where readability and
I don't think it is about readability:
$arr[3] = 'test';
$test = 3;
//This prints $test
echo This doesn't work: $$arr[3];
//This prints 3
echo This works: ${$arr[3]};
Using the same type way as before in this thread.
Above example is a classic one where readability and
On Thu, Oct 22, 2009 at 8:40 AM, Thodoris t...@kinetix.gr wrote:
I don't think it is about readability:
$arr[3] = 'test';
$test = 3;
//This prints $test
echo This doesn't work: $$arr[3];
//This prints 3
echo This works: ${$arr[3]};
Using the same type way as before in this thread.
2009/10/21 Bulend Kolay bma...@ihlas.net.tr:
I 'll send a mail in html form using php5.
cat send.php
?php
$variable=date1 ;
..
..
$message='
b There is a text $variable trial. /b
';
mail($to, $subject, $message, $headers) ;
?
when I run send.php, I get the mail. But I can't call
-
From: Andrew Ballard [mailto:aball...@gmail.com]
Sent: Wednesday, October 21, 2009 3:23 PM
To: Bulend Kolay
Cc: php-general@lists.php.net
Subject: Re: [PHP] how call a variable in a text
2009/10/21 Bulend Kolay bma...@ihlas.net.tr:
I 'll send a mail in html form using php5.
cat send.php
?php
type functions also.
David
-Original Message-
From: Andrew Ballard [mailto:aball...@gmail.com]
Sent: Wednesday, October 21, 2009 3:23 PM
To: Bulend Kolay
Cc: php-general@lists.php.net
Subject: Re: [PHP] how call a variable in a text
2009/10/21 Bulend Kolay bma...@ihlas.net.tr
@lists.php.net
Subject: RE: [PHP] how call a variable in a text
On Wed, 2009-10-21 at 15:40 -0500, David Murphy wrote:
This is actually much better the { and } make it very obvious where the
variable is and also it can keep odd issues from occurring sometimes.
$message=b
Ashley Sheridan wrote on 2009-10-21 22:43:
The {} only become really useful when you're trying to reference arrays
within a string:
$var = array('great', 'boring');
$text = this is {$var[0]}.;
Without the curly braces, PHP wouldn't be able to figure out whether you
wanted the end string to
...@ashleysheridan.co.uk]
Sent: Wednesday, October 21, 2009 3:43 PM
To: David Murphy
Cc: php-general@lists.php.net
Subject: RE: [PHP] how call a variable in a text
On Wed, 2009-10-21 at 15:40 -0500, David Murphy wrote:
This is actually much better the { and } make it very obvious where
On Wed, 2009-10-21 at 22:54 +0200, Kim Madsen wrote:
Ashley Sheridan wrote on 2009-10-21 22:43:
The {} only become really useful when you're trying to reference arrays
within a string:
$var = array('great', 'boring');
$text = this is {$var[0]}.;
Without the curly braces, PHP
Ashley Sheridan wrote on 2009-10-21 22:56:
Try this though:
?php
$var = array(array('great','alright'), 'boring');
print This is $var[0][0].;
Print This is different from your previous example :-);
--
Kind regards
Kim Emax - masterminds.dk
--
PHP General Mailing List
On Wed, 2009-10-21 at 23:11 +0200, Kim Madsen wrote:
Ashley Sheridan wrote on 2009-10-21 22:56:
Try this though:
?php
$var = array(array('great','alright'), 'boring');
print This is $var[0][0].;
Print This is different from your previous example :-);
--
Kind regards
Ashley Sheridan wrote:
On Wed, 2009-10-21 at 22:54 +0200, Kim Madsen wrote:
Ashley Sheridan wrote on 2009-10-21 22:43:
The {} only become really useful when you're trying to reference arrays
within a string:
$var = array('great', 'boring');
$text = this is {$var[0]}.;
Without the
22 matches
Mail list logo