Jump to content

Control Structure Spans Functions


markhuot

Recommended Posts

Hello,  I'm wondering if it's possible to do something like this:

[code]
function one()
{
    // ... set up variables
    foreach($variables as $var):
}

function two()
{
    endforeach;
}
[code]

I'm asking because I'm building a templating engine and I'd like to be able to call the one() function to start a loop of entries, then end the loop with the two() function.[/code][/code]
Link to comment
https://forums.phpfreaks.com/topic/34164-control-structure-spans-functions/
Share on other sites

Archived

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

×
×
  • Create New...

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.