techboy992 Posted January 19, 2015 Share Posted January 19, 2015 Hello guys I have a problem figure out how I can get value out from this string: userId ?userSessionToken=cd89584f-5711-4e0a-899a-ae9247fdcf0c I will be needing the: cd89584f-5711-4e0a-899a-ae9247fdcf0c only for my user api. Regards Brian Olsen Quote Link to comment https://forums.phpfreaks.com/topic/294052-get-token-from-_get/ Share on other sites More sharing options...
requinix Posted January 19, 2015 Share Posted January 19, 2015 parse_url to get the query string and parse_str to get it as an associative array. Quote Link to comment https://forums.phpfreaks.com/topic/294052-get-token-from-_get/#findComment-1503368 Share on other sites More sharing options...
techboy992 Posted January 19, 2015 Author Share Posted January 19, 2015 (edited) Hi there This string is coming from a java application, I have no option for pass the url direct as the url is generated in java and then send to my php script Could I have an example how you would do this the url is generated like this from java: https://www.exaple.com/site/acc.php?user_id=+userId+ Thanks in advance Regards Brian Olsen Edited January 19, 2015 by techboy992 Quote Link to comment https://forums.phpfreaks.com/topic/294052-get-token-from-_get/#findComment-1503370 Share on other sites More sharing options...
Ch0cu3r Posted January 19, 2015 Share Posted January 19, 2015 When you say Java do you mean JavaScript? As they totally different languages. Quote Link to comment https://forums.phpfreaks.com/topic/294052-get-token-from-_get/#findComment-1503373 Share on other sites More sharing options...
Solution techboy992 Posted January 19, 2015 Author Solution Share Posted January 19, 2015 Problem is solved Regards Brian Olsen Quote Link to comment https://forums.phpfreaks.com/topic/294052-get-token-from-_get/#findComment-1503374 Share on other sites More sharing options...
requinix Posted January 19, 2015 Share Posted January 19, 2015 I'm glad we knew exactly what was wrong and how to fix it, but really the thanks goes to you and your exceptional explanation of the problem. Quote Link to comment https://forums.phpfreaks.com/topic/294052-get-token-from-_get/#findComment-1503375 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.