Re: inserting php value in html shorter wayand downloading winword & mp3 files the fancy way

From: Date: Mon, 24 Aug 2009 16:36:40 +0000
Subject: Re: inserting php value in html shorter wayand downloading winword & mp3 files the fancy way
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-297135@lists.php.net to get a copy of this message
On Mon, Aug 24, 2009 at 05:56:46PM +0200, Grega Leskov??ek wrote: > Hi, I am still a newbie in php. Is there a shorter way to include a php > value in a form? > <input type="text" name="fullname" size="40" > value="<?php echo > {$user['fullname']}; ?>" /> > is it possible to do smth like this <?=php {$user['fullname']}; ?> like in > JSP? > Can I omit the last whitespace before the closing ?> ? Yes, you can include a PHP value in a script. Like this: ...size="40" value="<?php echo $user['fullname']; ?>" /> Your curly braces are redundant, and you must quote the "fullname" index if you're not quoting the whole $user['fullname'] expression. Yes, you can remove the final space after $user['fullname']; and before the tag closure (?>). But there's no reason to. Paul -- Paul M. Foster

« previous php.general (#297135) next »