On 10/7/06, sit1way <[EMAIL PROTECTED]> wrote:
I'm overhauling my PHP based CMS and want to know how to set a variable
equal to an HTML string, but without having to escape all the quotes!

Noah, meet HEREDOC.  HEREDOC, meet Noah:

http://uk.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

Now you cozy two, let's make it a party with the Complex (Curly {}) syntax:

http://uk.php.net/manual/en/language.types.string.php#language.types.string.parsing.complex

All together now!

[code]
$var =<<<HEREDOC
<form name="events" method="POST" action="">
   <select class="menus" name="news" onChange="MM_jumpMenu('parent',this,0);">
       <option selected="selected">News Options</option>
       <option value="{$this->doc_path}admin/news/add/1/">Add</option>
       <option value="{$this->doc_path}admin/news/update/1/">Update</option>
       <option value="{$this->doc_path}admin/news/delete/1/">Delete</option>
   </select>
</form>
HEREDOC;
[/code]

HTH,
John W

TIA,

--Noah




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



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

Reply via email to