/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmFeb 09.2014 — ???

Repeat: ???
Copy linkTweet thisAlerts:
@fsfernandes_hotauthorFeb 09.2014 — ???

Repeat: ???[/QUOTE]


what to repeat ????
Copy linkTweet thisAlerts:
@ginerjmFeb 09.2014 — 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.
Copy linkTweet thisAlerts:
@rootFeb 09.2014 — 
  • 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.
    Copy linkTweet thisAlerts:
    @rootFeb 09.2014 — I suspect that you need to do something like...

    http://uk3.php.net/manual/en/function.basename.php
    Copy linkTweet thisAlerts:
    @NogDogFeb 10.2014 — [u][url=http://www.php.net/manual/en/function.end.php]end[/url][/u]() 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:

    [code=php]
    $newArray = explode("/", $_SERVER['SCRIPT_NAME'])
    $sname = end($newArray);
    unset($newArray); // not really necessary, but will most closely mimic original code
    [/code]
    ×

    Success!

    Help @fsfernandes_hot spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.26,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...