AquariaXI Posted May 27, 2021 Share Posted May 27, 2021 (edited) So I'm trying to create an Array from a comma separated string containing array{s}. How can I take a string full of comma separated hex values such as : <?php $myStr = ( "00ffff", "00cccc", "009999", "007777", "004444", "001111", "01ffff", "01cccc", "019999" ); ?> & turn it into 3 separated arrays like : <?php $myNewArrs = [ Array1 ( 3 ), Array2 ( 3 ), Array3 ( 3 ), ]; ?> which REALLY looks like : <?php $myNewArrs = [ Array ( "00ffff", "00cccc", "009999" ), Array ( "007777", "004444", "001111" ), Array ( "01ffff", "01cccc", "019999" ), ]; ?> ? Any assistance is most-definitely appreciated! Thank you & have a great afternoon! Edited May 27, 2021 by AquariaXI Quote Link to comment https://forums.phpfreaks.com/topic/312800-array-from-comma-separated-string-containing-multiple-arrays/ Share on other sites More sharing options...
AquariaXI Posted May 28, 2021 Author Share Posted May 28, 2021 Please remove this topic. I was able to fix it myself! Quote Link to comment https://forums.phpfreaks.com/topic/312800-array-from-comma-separated-string-containing-multiple-arrays/#findComment-1586844 Share on other sites More sharing options...
Barand Posted May 28, 2021 Share Posted May 28, 2021 For the benefit of those others looking for a solution to a similar problem, why not post your solution. Quote Link to comment https://forums.phpfreaks.com/topic/312800-array-from-comma-separated-string-containing-multiple-arrays/#findComment-1586846 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.