Results 1 to 2 of 2

Thread: Variable creation from a function argument

  1. #1
    Join Date
    Apr 2006

    Question Variable creation from a function argument

    Hi There

    I have come across some code in someone's API that I wish to use myself and I wonder if anyone could advise me on how to use properly..

    I am able to call function
    without any return value.

    Subsequently, in my php I can retrieve with -
    print $array["variablename"]; //this has a value inside of it

    It seems like calling that function creates an $array with local scope, yet the initial call to playerProfile() did not have a return value..

    Does anyone know what I must put in the function definition to mimic this behaviour? Do I need a particular construct/keyword..

    Thanks in advance and Season's greetings


  2. #2
    Join Date
    Aug 2009
    Hi, I am not sure if this is what you are looking for, but you can pass a variable by reference, using '&' sign, for example:

    PHP Code:
    function foo(&$var)

    // $a is 6 here

    Support Chat software for your website

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center