A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearPHP arrow operator closing tags - page 1
User InfoPosts
PHP arrow operator closing tags#1
I am writing a php app on the websever I set up at my house. It is a fedora10 machine, running php5 and mysql. I have code like this:

<?php echo $var->function(); ?>


But for some reason the -> is closing the php tag, so the output has (function(); ?( added to it...is there something I need to change in my php or webserver configuration?

posted date: 2009-04-09 17:21:00


Re: PHP arrow operator closing tags#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-09 17:21:01


Re: PHP arrow operator closing tags#3
Is the page actually being read by PHP?

posted date: 2009-04-09 17:25:00


Re: PHP arrow operator closing tags#4
I dont think that you have mod_php enabled in your apache config file, or else you would never see the php code in the output. Here is a good tutorial on setting up php 5 in apache.

posted date: 2009-04-09 17:26:00


Re: PHP arrow operator closing tags#5
Try<?php echo("foo"); ?>If that doesn(t work, you don(t have PHP enabled in Apache.

posted date: 2009-04-09 17:27:00


Re: PHP arrow operator closing tags#6
yes...using regular, non-OO php works just fine

posted date: 2009-04-09 17:30:00


Re: PHP arrow operator closing tags#7
yes, php is enabled, I have been using it for a while, just never with any 'OO' php stuff before

posted date: 2009-04-09 17:31:00


Re: PHP arrow operator closing tags#8
i think, shane is right. the php code is interpreted as html. in your source you should see the php-code 1 by 1 - nothing is interpreted. the function() is displayed because <?php and -> act as html-open and -close tags.

posted date: 2009-04-09 21:29:00


Re: PHP arrow operator closing tags#9
If your(re sure that php is enabled, try this one<?php$result = $var -> function();echo $result;?>to debug it a little.. maybe something interesting will raise

posted date: 2009-04-09 22:17:00


Re: PHP arrow operator closing tags#10
It supposed to work. How about if you put those in different lines? Or delete the whole thing, and re-type it again.

posted date: 2009-04-09 22:25:00


Re: PHP arrow operator closing tags#11
Is the php enabled on server? A simple test for determining it:<?phpphpinfo();?>Put the above line in a .php file and access it.

posted date: 2009-04-09 22:33:00


Re: PHP arrow operator closing tags#12
You could also try this:<?php phpinfo();Final closing php tag isn(t required.

posted date: 2009-04-09 22:43:00


select page: « 1 2 »
Copyright ©2008-2017 www.momige.com, all rights reserved.