PHP code inside PHP

Discussion in 'PHP' started by jurgita, May 27, 2009.

  1. #1
    hi guys

    <?php

    ob_start();

    <?php do_function_1(); do_function_2(); blablabla(); ?>

    $var = ob_get_clean(); echo $var;

    ?>

    obviously it will not work.

    but is there a way to make is possible?

    before do_function_1(); must have <?php ..


    please help
     
    jurgita, May 27, 2009 IP
  2. jurgita

    jurgita Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i cannot use include function i.e. include 'somefiles.php';
     
    jurgita, May 27, 2009 IP
  3. jurgita

    jurgita Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <?php if(blabla) { ?>

    <?php functions... ?>

    <?php } ?>

    works.. but i dont have any if statement
     
    jurgita, May 27, 2009 IP
  4. jurgita

    jurgita Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    just solved my problem... anyway i still want to know about it
     
    jurgita, May 27, 2009 IP
  5. yoes_san

    yoes_san Peon

    Messages:
    443
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    why you need new <php> and not just use this?

    <?php

    ob_start();

    do_function_1(); do_function_2(); blablabla();

    $var = ob_get_clean(); echo $var;

    ?>
     
    yoes_san, May 27, 2009 IP
  6. Chikey.ru

    Chikey.ru Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    in php dont enable this syntax. onli <?--?><?--?>
     
    Chikey.ru, May 27, 2009 IP