I'm using Repeatable field Type.
The data from database are:
{"social_icon":["fa fa-facebook","fa fa-twitter","fa fa-linkedin"],"social_link":["https://www.facebook.com/user","https://www.twitter.com/user","https://www.linkedin.com/user"]}
array made wit $array_links = json_decode($social_links, true);
Array ( [social_icon] => Array ( [0] => fa fa-facebook [1] => fa fa-twitter [2] => fa fa-linkedin ) [social_link] => Array ( [0] => https://www.facebook.com/user [1] => https://www.twitter.com/user [2] => https://www.linkedin.com/user ) ) 1
if I get information through loop:
<?php foreach ($array_links as $key => $value) {
foreach ($value as $content) {
echo $content.'<br>';
}
} ?>
It shows me the following
fa fa-facebook
fa fa-twitter
fa fa-linkedin
https://www.facebook.com/user
https://www.twitter.com/user
https://www.linkedin.com/user
I want to build it:
<a href="https://www.facebook/user"><i class="fa fa-facebook"></i></a>
get data with $array_links[0][1];
not serve me, because they use some 6 links, and other links will not use.
Thanks for helping me.