php - Freak "1" number appear after require and echo blanc file -


i have freak problem :-)

please, see simple website: http://tests.vipserv.org/

there is... "1" number. in code there no "1"...

i converted eol unix. no results. changed coding utf with/without boom.

"website" created files: index.php:

<?php class view {     public static $tpl_view = 'view.php';      public static function renderview($template, $data = array()) {         echo require $template;     }      public static function generateview($template, $data = array()) {         return require $template;     } }  view::renderview(view::$tpl_view, ''); ?> 

and view.php:

(blanc) 

you can download files from:

http://ge.tt/4td1tei2/v/1

http://ge.tt/4td1tei2/v/0

thanks, a.

you echoing out yourself. according manual:

handling returns: include returns false on failure , raises warning. successful includes, unless overridden included file, return 1.

so instead of:

echo require $template; 

you want:

require $template; 

assuming template not supposed return of course.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -