Hi Everyone...

I am trying to do some Object calls within a PHP script which is INLINE within HTML. However the "->" PHP syntax is effectively closing the <?php start tag. How do I escape this syntax within the PHP to ensure the browser doesn't perceive it as a tag end?

Example:

blah........

<body>
<?php
if($thisUser->is_logged_in()){
$output='Welcome'
}
print $output;
?>
</body>

blah.........

The ">" of the "->" in $thisUser->is_logged_in() object call, causes the <?php to close. So what it renders to screen is straight text:

is_logged_in()){$output='Welcome'}print $output;?>

What is the best solution?

1 - Can I escape the ">"
2 - Would it make any difference if I abstracted the PHP into an seperate file?
3 - Is there another method for calling Object functions?

Cheers,
Todd

Just saved it as a PHP file instead of HTML. D'oH!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.