•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,399 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,496 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 536 | Replies: 1
![]() |
•
•
Join Date: Jan 2006
Location: Boston, MA
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
Hello,
I am familiar with the get_defined_functions() function as a way of listing all of the user defined functions.
Is there a way with PHP to also determine from which file the user function was defined?
Consider the following example. Assume there are three files:
- index.php
- user_functions1.inc.php
- user_functions2.inc.php
contents of user_functions1.inc.php:
contents of user_functions2.inc.php:
contents of index.php:
output of index.php:
I would like to use PHP to determine that user function example_function1 was defined in the file user_functions1.inc.php
Is this possible?
Thank you.
Dave
I am familiar with the get_defined_functions() function as a way of listing all of the user defined functions.
Is there a way with PHP to also determine from which file the user function was defined?
Consider the following example. Assume there are three files:
- index.php
- user_functions1.inc.php
- user_functions2.inc.php
contents of user_functions1.inc.php:
<?php
function example_function1() {
print "hello world 1";
}
?>contents of user_functions2.inc.php:
<?php
function example_function2() {
print "hello world 2";
}
?>contents of index.php:
<?php
include(user_functions1.inc.php);
include(user_functions2.inc.php);
$functions = get_defined_functions();
$user_functions = $functions['user'];
foreach($user_functions as $function) {
print "$function<br>";
}
?>output of index.php:
example_function1 example_function2
I would like to use PHP to determine that user function example_function1 was defined in the file user_functions1.inc.php
Is this possible?
Thank you.
Dave
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Open In New Window Php (PHP)
- Upload file without User Interaction (JavaScript / DHTML / AJAX)
- Upload file without User Interaction (PHP)
- Upload file without User Interaction (ASP.NET)
- User-Defined Function - part 2 (C++)
- Encrypt File using User Supplied Password (VB.NET)
- Determine File Extension Type (Perl)
- file save load problems (C++)
Other Threads in the PHP Forum
- Previous Thread: cPanel copy php errors help
- Next Thread: Image UPLOAD concept


Linear Mode