Reply to Variables Outside Functions

Your name:

Reply:


Posted by Angelos on 06/02/05 13:23

hello there...
I would like to ask if there is any way of using variables which are outside
functions in the functions without passing them when I call the function...
Complicated eehh ?

I have that :
*****************************************************
if (isset($_GET['category']) && isset($_GET['id'])) {
switch ($_GET['category']) {
case 'news':
echo "<h4>".date('d M Y',strtotime($release_date))."</h4>";
echo "<h3>".$content_title."</h3>";
echo "</p>".$body;
break;
}
}
else echo $body;
************************************************
and I want to convert it into that Function :
*************************************************
function displayContent(){
if (isset($_GET['category']) && isset($_GET['id'])) {
switch ($_GET['category']) {
case 'news':
echo "<h4>".date('d M Y',strtotime($release_date))."</h4>";
echo "<h3>".$content_title."</h3>";
echo "</p>".$body;
break;
}
}
else echo $body;
}
*****************************************************
ANd the question is : DO I have to pass all the variables that I use in the
function when I call it ?
I don't want to set the variables inside the functions because they are used
by other functions as well

May I have your lights PLS ?

[Back to original 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

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