Web Design, Development & Marketing
acuras services: Website Design & Development E-commerce Solutions Content Management Systems Online Marketing & Social Media Corporate Branding Social Media Training
Get in touch... Email Us: info@acuras.co.uk
acuras blog:7 Quick Tips to Keep Your SEO On Track in 2012 7 Social Media & SEO Tactics Businesses Will Adopt in 2012 latest posts:We are now trading as a Limited company Recent Work: Digital Marketing Material and Website Re-Designs Affordable Web Hosting and Domain Name Registration New Acuras Logo Coming Soon... Barclaycard ePDQ CPI Integrations HSBC XML API / CPI E-commerce Integrations Photoshop to Valid XHTML/CSS Coding Service Recommended Open Source Invoicing System Reasons Businesses should Embrace the Web blog archive:
Web Development ArticlesPHP: Include a file and store contents to variable using output bufferPublished: 5th Jun 2007 Bit of an obscure post this but I came across this very handy feature of PHP which allows you to include a file but store the contents of the included file to a variable. This is particularly useful for PHP scripts and software which output content to a page by using variables. Many CMSs are built like this.
The principal behind this solution is to use an output buffer. You start the output buffer, include the file(s), store the included content to a variable, then stop the output buffer. Code is shown below: ob_start(); // start bufferHope this comes in useful. Bye for now! Related LinksRelated Articles / PostsBarclaycard ePDQ CPI Integrations (27/05/2009) HSBC XML API / CPI E-commerce Integrations (02/04/2009) Recommended Open Source Invoicing System (25/03/2009) Recent Recommended Links - October 2008 (03/10/2008) Controlling PHP Register Globals Using .htaccess File (04/03/2008) |
||