Anonymous Posted November 10, 2022 Share Posted November 10, 2022 Question $a = abcde; $b = 123456; Output must be like this $a1b2c3d4e56; "can anyone solve??" Quote Link to comment https://forums.phpfreaks.com/topic/315511-for-loop-code-of-php/ Share on other sites More sharing options...
requinix Posted November 10, 2022 Share Posted November 10, 2022 What code have you tried so far, what did you expect to see it do, and what did it actually do? Quote Link to comment https://forums.phpfreaks.com/topic/315511-for-loop-code-of-php/#findComment-1602373 Share on other sites More sharing options...
phppup Posted November 10, 2022 Share Posted November 10, 2022 (edited) It looks like you have to find the LENGTH of each string to start. Then create an array for each variable that will hold the values of each position. Then use a loop to assemble a new STRING created from $a[0]$b[0]$a[1]$b[1].... etc. Edited November 10, 2022 by phppup Typos Quote Link to comment https://forums.phpfreaks.com/topic/315511-for-loop-code-of-php/#findComment-1602377 Share on other sites More sharing options...
ginerjm Posted November 10, 2022 Share Posted November 10, 2022 I would like to see the code that the OP has already tried. Otherwise we are just being asked to do his/her thinking for him... Quote Link to comment https://forums.phpfreaks.com/topic/315511-for-loop-code-of-php/#findComment-1602384 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.