I have two array I merge both with following code:
$information = array_merge($this->resInfo, $this->resName);
Here first array contain id and email while second contain name only. After merging both array name part and info part showing like this:
Array
(
[0] => Array
(
[id] => 91985
[email] => demo@example.com
)
[1] => Array
(
[id] => 71262
[email] => demo@example.com
)
[2] => Array
(
[name] => New york
)
[3] => Array
(
[name] => Alaska
)
[4] => Array
(
[name] => Sanfransico
)
)
The array containing id, email and name. Here my email field value is always showing same email id
while id field and name field value changing every time. I want to list email id only once while id and name as multiple depend on size. I created the following code:
<?php foreach ($information as $info) { ?>
<ul>
<li style="list-style: none;">
<a href="/profile/id/<?php echo $info['id']; ?>/email/<?php echo $info['email']; ?>" style="color: #185D9B; text-decoration: underline;">
<?php echo $info['name'] ?>
</a>
</li>
</ul>
<?php } ?>
Here it is showing both of the $info['name'] properly while it showing blank $info['id']; and $info['email']; in href tag.
Whats wrong with following code.
First time info index have a value like
so the first record is not display it’s name and link is not appear to you there is href value is correct but not display name
same for the index number 1 and 2 value
and when the index is 3 and 4 at that time value of the
so it is te display link but not href value are proper href value is=”/email/” only so it will not work properly
I hope you understood what i mean to say
if you have any problem in my answer then let me know…