PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   return statement question (http://www.phpdig.net/forum/showthread.php?t=2188)

JonnyNoog 10-05-2005 02:06 AM

return statement question
 
Hello,

I am trying to create a custom search results template for my site. I have found and read this thread and have successfully made the changes required up to the point where everything seems to be working except that I am getting some unexpected "1" characters displayed. From reading the before mentioned thread I gather this problem can be solved by implementing return() but am unsure how to do this. I am something of a php noob so sorry if this is an inane question but any assistance would be greatly appreciated.

Charter 10-05-2005 06:41 AM

Assuming you are wanting to include a PHP header and footer, make the PHP files like so, sticking the HTML content into a variable, and then returning that variable:
Code:

<?php

$my_header = <<<END
<html>
<body>
<!-- and so forth -->
END;

return $my_header;

?>


JonnyNoog 10-05-2005 05:35 PM

Thanks for that Charter, I knew it was an easy fix but just couldn't fit the final puzzle piece. Now I just have to modify the rest of my pages to use the same variable for the includes :).


All times are GMT -8. The time now is 06:06 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.