You are here: Re: How to define a new global function? « PHP Programming Language « IT news, forums, messages
Re: How to define a new global function?

Posted by Rik on 08/17/07 17:03

On Fri, 17 Aug 2007 19:00:12 +0200, Ming <minghuiyu@gmail.com> wrote:

> Very frequently, I need to use codes like this to see output clearly:
>
> $a=3Dprint_r($var,true);
> echo "<pre>$a</pre>";
>
> How can convert this piece of code to a global function (for example:
> echopre) in Php so that I can use echopre($data) anywhere in php
> program (in my server)?

Define the function somewhere? Functions are always in scope, there are =
no =

'local' or 'global' functions. So just put this code somewhere in the =

beginning/in a functions-include file:
<?php
function echopre($a){
$a=3Dprint_r($var,true);
echo "<pre>$a</pre>";
}
?>
-- =

Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация