Oddly enough, you can almost do this with list () , but you cannot use it in a function call. I only send it as you say 'more out of interest' : -
$_GET['unique'] = "blahblahblah=this_is_what_im_interested_in"; list(, $second) = explode('=', $_GET['unique']); var_dump($second);
Output: -
string 'this_is_what_im_interested_in' (length=29)
You can see good examples of how flexible list() is in the first set of examples on the page.
I think it's worth noting that although your example will work: -
$common->resetPasswordReply(explode('=', $_GET['unique'])[1]);
it really messes up your code, and itβs not obvious that you are going into this function. While something like the following is more readable: -
list(, $replyText) = explode('=', $_GET['unique']); $common->resetPasswordReply($replyText));
Consider returning to your code after 6 months and trying to debug it. Make it as standalone documentation as possible. Also, do not forget that when you enter user input here, it will need to be sanitized at some point.
source share