On Wed, 17 Jan 2001, Zenith wrote:
> ... may be I have use a wrong subject, but I can't think a more suitable one
> sorry first!
>
> say, I have a function like this
> function foo()
> {
> babababa...
> /*at this point, I want to output a lot of html, can I use a ':' to escape
> from there?*/
> /*I know I can do this is a if construct or for... construct, but I can't do
> this at this point*/
> /*is there any way for me to do the similar thing?*/
> }
>
As long as you have it inside braces you're okay:
<?php
function foo()
{
?>
<p>I am now inside function foo()...</p>
<?php
}
?>
> And I have one more question, what is the meaning of 'or'?
> e.g.
> $db=mysql_connect("localhost","root","password") or die ("could not
> connect");
>
It evaluates the left operand, and if false evaluates the right operand and
returns that, otherwise returns the result of the left. The above usage is
basically a cheat-type shortcut for:
if (!($db=mysql_connect("localhost","root","password")))
die ("could not connect");
--
Ignacio Vazquez-Abrams <[EMAIL PROTECTED]>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]