Fixed issue: Only variables should be passed by reference

If you getting issue “Only variables should be passed by reference” it comes because you are using direct value from one function to other function. So first get value from one function and assigned to variable and then that variable used in next function.

Issue:

if(!empty($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] != '/')
{
	$url =  end( array_filter( explode( DS , $_SERVER['REQUEST_URI']) ) );
}

Fixed:

if(!empty($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] != '/')
{
	$uri =  array_filter( explode( DS , $_SERVER['REQUEST_URI']) );
	$url = end($uri);
}

Cheer 🙂

Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes1
No0
Harinder Singh

Harinder Singh

My name is Harinder Singh and I specialize in Software industry. I consider myself as a life learner. I love learning new concepts, embracing new ideas and reading and searching for innovation.