Re: heredoc Problem Programming Web Development by nav33n Is it even possible without ending the identifier. [code=php] <?php echo <<<HEREDOC <div> HEREDOC; if($i==2) { echo <<<HEREDOC $i is 2 </div> HEREDOC; } [/code] I think this is the only possible way. I hope I am wrong. :) Cheers, Naveen Re: heredoc Problem Programming Web Development by R0bb0b maybe this? [CODE=php]<?php $output=<<<HEREDOC <div> HEREDOC; if($i==2) { $output.=<<<HEREDOC $i is 2 </div> HEREDOC; } echo $output; [/CODE] heredoc Problem Programming Web Development by pedramphp … dont want to brint the If statement out of the heredoc what is the solution [code]echo<<<ENDSTRING… Re: heredoc Problem Programming Web Development by somedude3488 i wouldn't use heredoc syntax in a situation like that. just use echo to output the html to page. if $i changes you could do this: [code] <?php echo <<<HTML <div>\$i is $i</div> HTML; ?> [/code] i don't know if thats what you were looking for mailx & heredoc Programming Software Development by k2k …, can anyone give me a brief example using mailx and heredoc to send an email? [CODE]#!/bin/sh mail -s "… Re: heredoc Problem Programming Web Development by pedramphp Um I think You're right I did think the same ... I'll check it if any body has any Idea please let us know Re: mailx & heredoc Programming Software Development by eggi Hey There, You should be good to go with just a little change-up: [QUOTE]cat <<EOF | mailx -s "subject" target@address hello all, this is supposed to be the body of the mail EOF[/QUOTE] Hope that helps you out :) , Mike Re: mailx & heredoc Programming Software Development by k2k [QUOTE=eggi;650067]Hey There, You should be good to go with just a little change-up: Hope that helps you out :) , Mike[/QUOTE] Mike, thanks again, and it surely works. Would you explain a little bit of what you have done? cat <<EOF | mailx -s "subject" target@address is it like, you cat … Re: mailx & heredoc Programming Software Development by eggi Hey, no problem, glad I could help out :) The syntax of this is a little confusing, even to me if I just give it a quick glance. But so many things with Linux/Unix are until you get used to them ;) Basically, I'm catting everything up to the EOF delimiter (which could have been called anything like END or something) and piping all that to … Re: The Use of echo <<< Programming Web Development by broj1 … delimited with single or double quotes, but with heredoc you declare (name) an identifier. This way…('parameter1','parameter2','$var_parameter3')\" />';[/CODE] Using heredoc syntax you can code this way (maybe a …')" /> HTMLCODE;[/CODE] Note variables within heredoc get parsed as with double quoted strings. There is… Feedback/suggestions on PHP speed testing site Programming Web Development by chrelad …right now: Comparison of string concat/replace methods [LIST] [*]Heredoc with interpolation [*]Double quote with interpolation [*]Double quote concat [*]…Single quote concat [*]Heredoc with multiple str_replace's [*]Heredoc with bulk str_replace [*]Heredoc with sprintf [*]Heredoc with preg_replace [/LIST] Comparison of… Re: Adding text inside output variable Programming Web Development by rproffitt … no. About all that I see in heredoc mode is the need to escape the dollar…given PHP will sub in variables in the heredoc mode, I think I'm back to my…to insert some variable into your code and heredoc. This change the variable to be the …language.types.string.php#language.types.string.syntax.heredoc Notice how the substition works in example 7… Adding text inside output variable Programming Web Development by idaryl … am using this output from a radio array in a heredoc output {$custom_radio2_2} and wanted to add a font awseome icon…;/i>` - however if I just use it in the heredoc its always present...and I just want it to appear… Re: Adding text inside output variable Programming Web Development by idaryl The only way I can get an icon to show, is to put it in the heredoc output - because if I try it in the array it breaks. Probably becaue of the <> operators or the / that is associated with the string - could they be escaped in the array? Parse error please help Programming Web Development by Mitch1979 …('includes/header_footer.php') site_header('Registration'); //Superglobals don't work with heredoc $php_self = $_Server['PHP_SELF']; $reg_str = <<< EOREGSTR <TABLE… The Use of echo <<< Programming Web Development by Pro2000 [COLOR="Green"]Hello everybody.. I've read about the "heredoc" way of outputting strings.. Where can we consider this use handy?? Is it used only to avoid escaping the single and double quotation mark?? Also, why is there an identifier to be put at the first and end of the function?? Thanks beforehand.[/COLOR] PHP signin sheet Programming Web Development by xtra333 … line 15. I know there is something wrong with the heredoc syntax I have, but I do not know why. [CODE… Failed to show a form Programming Web Development by 21122012 … = mysql_query($SQL, $conn) or die(mysql_error()); $row_rs = mysql_fetch_assoc($rs); // use heredoc syntax to quote a string and store it in variable… Regex help on preg_replace Programming Web Development by diafol …; So the page content is held in a var via heredoc syntax. That's all well and good. My index.php… CSS issue in php and HTML email Programming Web Development by Albert Pinto … know how to tackle it.. I've tried escape sequences, heredoc, htmlspecialchars_decode.... But all in vain.. Sorry for the lengthy post… variable inside heredoc Programming Software Development by woodson2 I currently use this message to send e-mails in a script but I would also like to save the output of this code to a file as well while preserving the variables. What's the easiest way to accomplish this? when=`/bin/date` /usr/sbin/sendmail -t >2 <<-EOM Subject:User access disabled. From:testuser@test.com To:$EMAIL User $USERNAME has … Re: variable inside heredoc Programming Software Development by griswolf If you want to save the actual email, see the [tee](http://linux.about.com/library/cmd/blcmdl1_tee.htm) command, or just send it to a post box that has a mail filter that refiles it as needed. Re: T_STRING error online but runs fine on XAMPP Programming Web Development by KLMKLMKLM … you need to print something like for use HEREDOC syntax. And goto? Can't beilieve it!…echo $form;[/CODE][/QUOTE] Thank you for the heredoc idea. Like I said, the code was a… a paragraph, but now I have Googled heredoc and seen another description of what you said… make an even cleaner-looking code using heredoc syntax. I was looking for a way… Re: T_STRING error online but runs fine on XAMPP Programming Web Development by KLMKLMKLM …HTML and jumped back in to resume parsing; I used heredoc syntax from top to bottom. Couple of things to …watch for with this heredoc syntax: DO NOT leave any whitespace after the opening TOC… weren't needed anymore. Discovered these as I rewrote with heredoc. [CODE]if ( (is_null($day)) and ($div = 0) ) {echo <&… Re: using php with html & css Programming Web Development by almostbob … html in single lines, up to book-amounts of text heredoc or nowdoc format can do pretty much what you want… "stuff" 'stuff' \x41 (capital A) somethingelse; [php strings heredoc](http://php.net/manual/en/language.types.string.php#language… Re: Problems with redirecting...please help Programming Web Development by kanaku … don't have to reopen the php tags in a heredoc (heredoc is the EOT thing you're using). So if [icode… curly braces are for the array value. My source for heredoc info is [URL="http://www.hudzilla.org/php/2_6_3… Re: PHP Code for Mailer Programming Web Development by Josh Connerty They woudln't replace HereDoc. With NowDoc that would defeat the whole purpose of HereDoc. I love HereDoc. Good for making results pages. Means you can make a whole html page and stick the PHP in without having to use the tags etc Re: how to seprate php with html Programming Web Development by diafol You could also look at HEREDOC: [URL="http://uk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc"]php manual on HEREDOC[/URL]. It may help. Re: Problem with loop in php Programming Web Development by mschroeder … want to remove your php even more from your html, HEREDOC and NOWDOC (php 5.3 +) make this very easy with…/manual/en/language.types.string.php#language.types.string.syntax.heredoc"]HEREDOC[/URL] with the sprintf functions, *BUT* you must escape… Re: How to add javascript to php? Programming Web Development by broj1 …gt;\";"; } // compose javascript code using heredoc syntax // see http://www.php.net/manual/en/…language.types.string.php#language.types.string.syntax.heredoc $javascript = <<<JSCODE <… echo $javascript; If you do not like heredoc syntax you can compose the javascript code string…