PewPew87 Posted April 6, 2020 Share Posted April 6, 2020 Hey, im struggeling with a small piece of code.... Thats my code: Global $user_ID; $user_ID = get_current_user_id(); echo"User number $user_ID is loggedin"; Echo gives me this: "User number 2 is loggedin" Now i want to add it to my array: $atts['href'] .= $user_ID . 'abc'; 'href' is set to "https://test.com/" What im getting now ist https://test.com/abc Can someone tell my why the '2' is missing?? Quote Link to comment https://forums.phpfreaks.com/topic/310482-php-add-variable-to-array/ Share on other sites More sharing options...
ginerjm Posted April 6, 2020 Share Posted April 6, 2020 Not without seeing a contiguous set of code showing us what all is happening. Ps - It's "struggling". Quote Link to comment https://forums.phpfreaks.com/topic/310482-php-add-variable-to-array/#findComment-1576452 Share on other sites More sharing options...
ginerjm Posted April 6, 2020 Share Posted April 6, 2020 A good thing to NOT do in php is mix upper and lowercases. This is not JS. Stick to lower case. I'm guessing that you do not have error checking turned on and that you mis-typed or misspelled your user id variable. Quote Link to comment https://forums.phpfreaks.com/topic/310482-php-add-variable-to-array/#findComment-1576454 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.