count newlines in heredoc variable
- From: Adam Cantrell <cantrell78@xxxxxxxxx>
- Date: Wed, 30 Jul 2008 11:21:21 -0700 (PDT)
How could I count the number of newlines in a heredoc variable? This
outputs 0, but I thought heredoc preserved newlines?
<?
$test = <<<END
<a href="test5.php">adam</a>
<p>
Hi There
</p>
END;
echo substr_count($test, '\n');
?>
.
- Follow-Ups:
- Re: count newlines in heredoc variable
- From: petersprc
- Re: count newlines in heredoc variable
- Prev by Date: Re: <? view_content(78) ?>
- Next by Date: Re: count newlines in heredoc variable
- Previous by thread: online users
- Next by thread: Re: count newlines in heredoc variable
- Index(es):