very basic question on function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Personne

    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

  • bakercad@gmail.com

    #2
    Re: very basic question on function

    On Jun 26, 2:07 pm, Personne <cpdiv...@gmail .comwrote:
    <?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

    Comment

    • Personne

      #3
      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

      Comment

      • phpCodeHead

        #4
        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

        Comment

        • Captain Paralytic

          #5
          Re: very basic question on function

          On 28 Jun, 14:15, phpCodeHead <phpcodeh...@gm ail.comwrote:
          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.

          Comment

          Working...