very basic question on function

This is a discussion on very basic question on function within the PHP Language forums, part of the PHP Programming Forums category; <?php function h() { echo 'hello'; } ?> BIG <? h(); ?> Result with PHP4.3.10/Apache1.3.33 => ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-26-2007
Personne
 
Posts: n/a
Default very basic question on function

<?php
function h()
{
echo 'hello';
}
?>
BIG
<? h(); ?>


Result with PHP4.3.10/Apache1.3.33 => BIGBIGhello
Result with PHP5.2.6/Apache2.2.3 => BIG

with PHP 5.2.6
hello is not displayed
why?
how can I fix this?

Thank you

Reply With Quote
  #2 (permalink)  
Old 06-26-2007
bakercad@gmail.com
 
Posts: n/a
Default Re: very basic question on function

On Jun 26, 2:07 pm, Personne <cpdiv...@gmail.com> wrote:
> <?php
> function h()
> {
> echo 'hello';}
>
> ?>
> BIG
> <? h(); ?>
>
> Result with PHP4.3.10/Apache1.3.33 => BIGBIGhello
> Result with PHP5.2.6/Apache2.2.3 => BIG
>
> with PHP 5.2.6
> hello is not displayed
> why?
> how can I fix this?
>
> Thank you



maybe change
<? h(); ?>
to
<?php h(); ?>

short_open_tag may not be enabled on the PHP5.2.6 install

Reply With Quote
  #3 (permalink)  
Old 06-26-2007
Personne
 
Posts: n/a
Default Re: very basic question on function

I figured this out 1 minute after I posted !!!

Any I have more problem now, pages are renderer differently

Thank you anyway, for this fast answer

Reply With Quote
  #4 (permalink)  
Old 06-28-2007
phpCodeHead
 
Posts: n/a
Default Re: very basic question on function


Personne wrote:
> I figured this out 1 minute after I posted !!!
>
> Any I have more problem now, pages are renderer differently
>
> Thank you anyway, for this fast answer


well, Personne, why don't you share with all of us what your solution
was so that the whole user community can learn from it as this is what
I thought was one of the sole purposes of this great online community.

I guess I could be wrong here...

Thanks,

Gene Kelley

Reply With Quote
  #5 (permalink)  
Old 06-28-2007
Captain Paralytic
 
Posts: n/a
Default Re: very basic question on function

On 28 Jun, 14:15, phpCodeHead <phpcodeh...@gmail.com> wrote:
> Personne wrote:
> > I figured this out 1 minute after I posted !!!

>
> > Any I have more problem now, pages are renderer differently

>
> > Thank you anyway, for this fast answer

>
> well, Personne, why don't you share with all of us what your solution
> was so that the whole user community can learn from it as this is what
> I thought was one of the sole purposes of this great online community.
>
> I guess I could be wrong here...
>
> Thanks,
>
> Gene Kelley


I think you are wrong here. If you read carefully:

1) Personne posted the question
2) baker posted teh answer
3) Personne said that he also worked this out (1 minute after I
posted) and thanked baker for his fast answer.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:02 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0