Hi,
I just came across a sniplet of code in a book I'm reading and I'm not
sure what point the author is trying to make.
The code is:
function my_function ( )
{
echo 'My function was called';
}
<?php
function my_function ( )
{
?>
My function was called
<?php
}
?>
What are those single opening and closing curly braces doing in
separate <?php ?> tag blocks? What's the point?
The author says "Withing a function, curly braces enclose the code
that performs the task you require. Between these braces, you can have
anything that is legal elsewheere in a PHP script" - PHP and MySQL Web
Development, 3rd Edition: Welling & Thomson.
If the point is to illustrate what this quote says, does that mean...
{
?>
My function was called
<?php
}
...is a syntactically correct code block for my_function?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php