[PHP] String construction help required please

2003-12-01 Thread Dave Carrera
Hi List,

I need to construct a string to visually show to the user some $_POST vars.

I need to display : $_POST[$var], 

Including the  and the , .

I have tried : \\$_POST[\.$var.\], but that is very wrong.

Could one of you kind list members show me what it should be please ?

Thank you in advance for any help.

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] String construction help required please

2003-12-01 Thread Robert Cummings
On Mon, 2003-12-01 at 01:59, Dave Carrera wrote:
 Hi List,
 
 I need to construct a string to visually show to the user some $_POST vars.
 
 I need to display : $_POST[$var], 
 
 Including the  and the , .
 
 I have tried : \\$_POST[\.$var.\], but that is very wrong.
 
 Could one of you kind list members show me what it should be please ?
 
 Thank you in advance for any help.

Doyou mean you want to do the following? :

echo ''.$_POST[$var].',';

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] String construction help required please

2003-12-01 Thread Justin French
On Monday, December 1, 2003, at 05:59  PM, Dave Carrera wrote:


I need to construct a string to visually show to the user some $_POST 
vars.

I need to display : $_POST[$var],

Including the  and the , .

I have tried : \\$_POST[\.$var.\], but that is very wrong.

Could one of you kind list members show me what it should be please ?


You have a couple of options... just pick the one that suits you...

?
echo \{$_POST[$var]},\;
echo ''.$_POST[$var].',';
?
Justin French

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] String construction help required please

2003-12-01 Thread Jay Blanchard
[snip]
 I need to display : $_POST[$var],

 Including the  and the , .

 I have tried : \\$_POST[\.$var.\], but that is very wrong.

 Could one of you kind list members show me what it should be please ?


You have a couple of options... just pick the one that suits you...

?
echo \{$_POST[$var]},\;
echo ''.$_POST[$var].',';
?
[/snip]

var should not have a $ in front of it, should it? 

echo \{$_POST['var']},\;
echo ''.$_POST['var'].',';

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] String construction help required please

2003-12-01 Thread Wouter van Vliet
Jay Blanchard wrote:
 [snip]
 I need to display : $_POST[$var],
 
 Including the  and the , .
 
 I have tried : \\$_POST[\.$var.\], but that is very wrong.
 
 Could one of you kind list members show me what it should be please ?
 
 
 You have a couple of options... just pick the one that suits you...
 
 ?
 echo \{$_POST[$var]},\;
 echo ''.$_POST[$var].',';
 
 [/snip]
 
 var should not have a $ in front of it, should it?
 
 echo \{$_POST['var']},\;
 echo ''.$_POST['var'].',';

That all depends. Consider the following:

Assume:
input type='text' name='something' value='foo'
to be posted to the script

print '$_POST[$var],'; // prints (literally): $_POST[$var],
print ''.$_POST['something'].,; // prints: foo,
print ''.$_POST[$var].,; // Issues a 'notice: undefined index..' and
prints: ,

$var = 'something';
print ''.$_POST[$var].,; // prints: foo,

Pick your flavor.

Wouter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php