Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP define function as array

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25220
    mattvot
    Member

    You know you get arrays and you can define your own function, can and how do you merge them.

    So i define the function help() and use help(heart,blood,ab) to call it

    #59416

    Not sure. You can pass an array to a php function and access it like any array.

    Code:
    $arr = array(“one”, “two”, “three”);

    help($arr);

    function help($args) {
    foreach ($args as $arg) {
    echo $arg . “n”;
    }
    }

    Or you can access the list of passed variables using fung_get_args().

    Code:
    help2(“one”, “two”, “three”);

    function help2() {
    foreach( func_get_args() as $arg) {
    echo $arg . “n”;
    }
    }

    #59418
    mattvot
    Member

    that first idea is good idea!!!! just what I wanted thanks. Matt

    #59424
    mattvot
    Member

    Thanks, but I got confused lol.

    This is what I have so far

    Code:

    I want to set it up so I don’t need these wasted instructions. Something like this because I will have alot of domains.

    Code:

    BTW i know I cannot use redirect, but i’m not very creative atm. :D

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.