...

View Full Version : PLEASE help!!!



zasnemo
08-28-2006, 03:18 AM
how can i pass variables from an function to a include inside it?

<?php
// index.php
function a() {
$a= 'apples';
include('fuit.php');

}

?>

<?php
// fruit.php
echo $a;
?>

THANKS!!

Spookster
08-28-2006, 06:22 AM
In the future, please use a more descriptive subject when posting a question. See posting guidelines. (http://www.codingforums.com/postguide.htm)

Anthony2oo4
08-29-2006, 12:04 AM
try:


<?php
global $a;
// index.php
function a() {
$a= 'apples';
include('fruit.php');

}

?>

<?php
// fruit.php
echo $a;
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum