I assume that the url is a request to your website? (if not, give us some more information)
public function index(Request $request)
{
$partner = $request->input('partner');
$token = $request->input('token');
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How can i get partner and token value from this link
https://steamcommunity.com/tradeoffer/new/?partner=126763931&token=DUROP2Q9
@emilpapelas4@gmail.com As it's not a URL from your website, you can do this
$URL = 'https://steamcommunity.com/tradeoffer/new/?partner=126763931&token=DUROP2Q9';
$parse = parse_url($URL);
$explode = explode('&', $parse['query']);
print_r($explode);
And the result is
[
[0] => partner=126763931
[1] => token=DUROP2Q9
]
And if you want to retrieve only the values you can str_replace
$URL = 'https://steamcommunity.com/tradeoffer/new/?partner=126763931&token=DUROP2Q9';
$parse = parse_url($URL);
$explode = explode('&', $parse['query']);
$partner = str_replace('partner=', '', $explode[0]);
$token = str_replace('token=', '', $explode[1]);
and the result of this will be
$partner = 126763931;
$token = "DUROP2Q9";
Please or to participate in this conversation.