www.webdeveloper.com
Results 1 to 7 of 7

Thread: Strict Standards: Only variables should be passed by reference

  1. #1
    Join Date
    Feb 2014
    Posts
    2

    Strict Standards: Only variables should be passed by reference

    Strict Standards: Only variables should be passed by reference in on line 3

    the code on line 3 is as below

    $sname = end(explode("/",$_SERVER['SCRIPT_NAME']));

    Please some can help to edit the script

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    877
    ???

    Repeat: ???

  3. #3
    Join Date
    Feb 2014
    Posts
    2
    Quote Originally Posted by ginerjm View Post
    ???

    Repeat: ???
    what to repeat ????

  4. #4
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    877
    I'm NOT A guru so I find it difficult to figure out what you are having a problem with.

    Hence the ???

    Perhaps YOU could take the time to detail your problem so that we may get the context of your situation and then you could tell us what is wrong.

  5. #5
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,500
    1. please supply any code wrapped in forum tags
    2. include code from the first line, or if its a large chink then indicate what line number the editor refers to
    3. please supply the error as PHP defines it or the web browser, whichever is complaining.

    It helps.
    Thanks.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  6. #6
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,500
    I suspect that you need to do something like...
    http://uk3.php.net/manual/en/function.basename.php
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

  7. #7
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,616
    end() takes one argument, which is of type Array and which is passed by reference (the "&" operator before the "$" in the function prototype there.) You are not passing it an array variable, but instead an expression which returns an array. To avoid this warning:
    PHP Code:
    $newArray explode("/"$_SERVER['SCRIPT_NAME'])
    $sname end($newArray);
    unset(
    $newArray); // not really necessary, but will most closely mimic original code 
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

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



Recent Articles