I fund few posts to explode data as array but mine is bit specific because the data has 2 parts
I have this
title=Title1|link=Link1
title=Title2|link=Link2
and result I need is this
Array
(
[0] => Array
(
[title] => Title1
[link] => Link1
)
[1] => Array
(
[title] => Title2
[link] => Link2
)
)
data is coming from texarea separated by \n so the data you see is actual data
thank you!
I’m more a fan of
explode()thanpreg_match()when you don’t actually need regular expressions.Don’t forget to add code to handle lines that don’t match the pattern you expect. Input validation is important.