...

View Full Version : User-defined function library?



MaverickMT
02-07-2003, 07:27 AM
Hi. I hope this is a quick and easy question for you guys. I'm trying to include() a php that just has function declarations. I hoped that could be a common resource for all my pages on the site. When I try to use the functions, however, it doesn't recognize them. Is there a way to make my own library or just include them properly? I'm open to suggestions. Thanks

Íkii
02-07-2003, 01:39 PM
should be fine as long as the functions are included prior to the include call - and as long as the include is a php page and the contents surrounded by <?php ?> tags.

any class of functions would be used similarly - included and then called

func.php
<?php
function &doublit($arg)
{
$res = $arg*2;
return $res;
}
?>

call.php
include('func.php');
$blat = &doublit(12);
echo $blat;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum