Welcome Guest, Not a member yet? Register   Sign In
Search for a certain function in all helper files?
#11

[eluser]Nummero2[/eluser]
Ok if I code as following:

Code:
$helpers = glob(APPPATH.'helpers/*_helper.php');

$i=0;
foreach ($helpers as $line) {


preg_match('/function([^\(]+)/',$line,$matches_array);

echo var_dump( $matches_array );
$i++;
}

I get the following on the screen:

"array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(0) { } array(2) { [0]=> string(20) "functions_helper.php" [1]=> string(12) "s_helper.php" }"

When I leave the ^ out of the "old" statement I get an empty array as before.

The function in the helper files looks like this:

Code:
function example_helper_test( $echo=false )

so example are the various helper files like: example1 example2 and so on the funcion is always _helper_test .


Messages In This Thread
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 04:27 AM
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 04:42 AM
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 08:48 AM
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 08:59 AM
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 11:40 AM
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 12:13 PM
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 04:10 PM
Search for a certain function in all helper files? - by El Forum - 08-14-2008, 05:12 PM
Search for a certain function in all helper files? - by El Forum - 08-15-2008, 04:26 AM
Search for a certain function in all helper files? - by El Forum - 08-15-2008, 07:31 AM
Search for a certain function in all helper files? - by El Forum - 08-15-2008, 11:43 AM
Search for a certain function in all helper files? - by El Forum - 08-15-2008, 02:14 PM
Search for a certain function in all helper files? - by El Forum - 08-17-2008, 06:39 AM
Search for a certain function in all helper files? - by El Forum - 08-17-2008, 09:04 AM
Search for a certain function in all helper files? - by El Forum - 08-18-2008, 01:55 AM
Search for a certain function in all helper files? - by El Forum - 08-18-2008, 02:23 AM
Search for a certain function in all helper files? - by El Forum - 08-18-2008, 06:08 AM
Search for a certain function in all helper files? - by El Forum - 08-18-2008, 06:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB