last day (14 days later) » 

10:52 AM
3
A: How to convert a string to an array?

Praveen KumarYou can use a double explode. $str = explode(PHP_EOL, $str); $arr = array(); foreach ($str as $val) { $arr[] = explode(":", $val); } You might need to trim() in all the cases I guess.

 
I think you have to remove all html tags. Here is the output of your code 3v4l.org/dqrCg
 
@stack I thought you did that using strip_tags(). Man, we can't spoon feed you! We can guide you to write code.
 
Yes I can use it, thank you, I just mentioned to that point because I wanted when other users use your code, then see a desired result. anyway ok thanks again. +1
 
@stack Once you get it right, feel free to edit my answer bro! :) You have all rights! :)
 
To be honest, that's scare for me to edit your answer, who has 80K rep :) .
 
10:52 AM
@stack I just gave you the full freedom. Doesn't mean if I have 80k Rep, I am a master! And those with less are not! :)
@stack This is an open community, where everyone has equal rights to talk and do stuff, as long as it doesn't hurt anyone. That's the main point.
 
Agreed, You are completely right.
 
@stack If you are still afraid, LoL, send me the code, and I will edit my answer! Haha... :)
 
I'm working your idea .. still there is some small problem, I will edit your solution when I solve them.
 
Hey buddy...
You missed the trim($str) and it should be everywhere.
 
Look, First of all, your speed is insane ...
@PraveenKumar Yes, lemme check it
 
10:54 AM
Thanks... :)
I guess you got one answer which uses Regex...
 
Yes ... Sounds great
what you think?
 
Well, personally I hate regex becoz I don't know! LoL.
But if you wanna accept that or if you wanna try mine and get it to final version and accept mine, no worries. :)
Anything which you think is fair, go ahead. :)
 
Look, your answer is completely correct 3v4l.org/XnEsT !! But may you please let me to I accept another answer?
 
No worries bro! :) Go ahead... Which one?
 
regex :P
Well, sorry :(
 
11:00 AM
Go for it... Awesome... :)
No I am happy...
 
@PraveenKumar Your culture is adorable ..! Bravo
 
You are welcome bro...
Have a nice day bro... :)
See you then. Happy that you got your issue solved here.
 
Thank you :-) Really nice to meet you :-)
happy coding
 
 
5 hours later…
3:38 PM
Sure... Same here.
 

last day (14 days later) »