Discard ob_start ~

Source: Internet
Author: User
Content. php {code...} template. php {code...} originally used the ob_start function to output OOXX content to the template. Is there an alternative? This seems to occupy a lot of memory, and I don't think it is necessary to buffer it ~ I found that the variable can be parsed, and the function won't work. I will continue to use it ~ Http :... Content. php

ob_start();OOXX;$ooxx = ob_get_clean();

Template. php

echo $ooxx;

In the original function, the ob_start function outputs OOXX content to the template. Is there an alternative? This seems to occupy a lot of memory, and I don't think it is necessary to buffer it ~

I found that the variable can be parsed, and the function won't work. I will continue to use it ~ Http://thinkdiff.net/php/alternative-way-of-assigning-html-in-php-php-tips/

Content. php

$ooxx    =   <<
  

template.php

echo $ooxx;

Reply content:

Content. php

ob_start();OOXX;$ooxx = ob_get_clean();

Template. php

echo $ooxx;

In the original function, the ob_start function outputs OOXX content to the template. Is there an alternative? This seems to occupy a lot of memory, and I don't think it is necessary to buffer it ~

I found that the variable can be parsed, and the function won't work. I will continue to use it ~ Http://thinkdiff.net/php/alternative-way-of-assigning-html-in-php-php-tips/

Content. php

$ooxx    =   <<
   

template.php

echo $ooxx;

ob_startVery expensiveCPUInstead of memory? The first time I heard this, it described the performance of this function. Master station, honest and practical !! No alternative

If you do not need to replace the content before the output, you do not need to directly output the content. No replacement scheme...

I don't know why. I called ob when rendering the template.Start. In $ this->View-> render ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.