1

I have a page called main.php which includes a file titled functions.php. The main.php calls a function split-array() from the included functions.php file.

The array gets passed into split-array(). Now I want to pass THAT array into another function called do_list() in the SAME functions.php file, which then should show the result in the main.php.

How do I achieve that?

0

1 Answer 1

1

You can use following way to solve your issue.

main.php

<?php

include 'functions.php';

$arr = array(...);

$result = do_list(split-array($arr));
Sign up to request clarification or add additional context in comments.

1 Comment

Good solution. Could be also somethink like this: $res = split-array($arr); function split-array($arr) { ... return do_list($arr); } depending on the logic ofcourse.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.