Reply to Re: Getting a function result while in heredoc

Your name:

Reply:


Posted by Benjamin on 12/20/06 03:33

bill wrote:
> Thanks to those that taught me to use heredoc to embed html in
> php. I don't want to start the html in php vs php in html
> discussion again.,
>
> heredoc works a treat for that which I am doing except:
> In the generated html I have a number of checkboxes. I fill
> in the checkboxes from a boolean value in a mySQL table. To make
> this easier I use a function that takes the boolean and return
> either 'checked' or ''. This worked well when I was
> concatenating the html into a variable rather than using heredoc,
> but it was really messy.
>
> Short, simple question: is there anyway to get php to evaluate a
> function while in a heredoc block ?
You can't do this with any string syntax.
>
> I know I could assign the results of using the function to
> variables outside of the heredoc block or I could break the block
> for the function, but the first is cumbersome and the second gets
> rid of the clarity of the heredoc approach.
I'm afraid this is the only way. Maybe fill an array with the return of
functions?
>
> bill

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация