Jump to content


This topic is now archived and is closed to further replies.

Guest askjames01

HEREDOC manipulation?

Recommended Posts

Guest askjames01
ok, let say i have a HEREDOC like this below,

$str = <<<EOD
The heredoc line one
Second string
The last string of HEREDOC

what i want to do is to get the 2nd string line or row and then store it in a variable name.
then to determine the longest row, between the three rows and store the longest row
length value in a variable.
and last is to get the TOTAL number of rows of the HEREDOC strings.

is this probable or not?

thanks n advance.

Share this post

Link to post
Share on other sites
I'm not sure what you're trying to do. The only reason you would use HEREDOC is to echo something. If you want to do string comparisons, put the strings into an array.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.