Re: Escaping double quotes

From: Date: Thu, 25 May 2006 19:45:18 +0000
Subject: Re: Escaping double quotes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-236905@lists.php.net to get a copy of this message
On 25/05/06, Pavleck, Jeremy D. <Jeremy.Pavleck@capella.edu> wrote:
So I'm writing this page (PHP Newbie here) and it checks to see if a var is set, if it isn't it spits out the form info like so: echo "<form action="myform.php" method="post">"; Now is there a way to 'wrap' that so I don't have to escape quotes? Something like perls 'qq' function is what I'm looking for. I tried a few different functions from the website, magic_quotes, addslashes, htmlspecial etc etc but none did what I was looking for You know you can switch the php parser on and off like so:
<?php if (isset($var)) { ?> <form action="myform.php" method="post"> <?php } ?> which is a bit more efficient and better than all those echo statements and escapes? -- http://www.web-buddha.co.uk dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css) look out for project karma, our new venture, coming soon!

« previous php.general (#236905) next »