Let me explain bellow practically what i have and have i need
I'll be using this data in PHP, MySQL and WordPress Project, Currently I have these data in JSON file.
array_texts:
Link Text 1; Link Text 2; Link Text 3
array_links
https://url1.com; https://url2.com; https://url3.com
this is not limited to 3 i have more & less.
I need the best solution to use huge data from JSON to PHP/Wordpress with MySQL (Which ever works faster)
Expected result for each Link Text
<a href="https://url.com">Link Text</a>
and the whole combination as array or something like:
Link Text 1; Link Text 2; Link Text 3
<a href="https://url1.com">Link Text 1</a>; <a href="https://url2.com">Link Text 2</a>; <a href="https://url3.com">Link Text 3</a>
How about use
explode
andimplode
to break the string, combine them witharray_map
(manual - notice the use ofnull
in the function) andforeach
as:This will give you the desire output
Live example 3v4l