Current I use toggle to show/hide details. I need to give each div a unique ID in foreach loop. I'm not sure how to make it works on an echo string. Can you help me?
<?php
$i = 0;
foreach ( $payment as $payment_id => $items ) {
foreach ( $items as $item ) {
$i++;
$count = 0;
// Echo, need to show unique ID in both $count, it must be the same
echo '<p><strong><a href="#">Link</a></strong>
<br/><a href="#" class="show_info" id="'.$count.'">Show Details</a>
<div id="payment_info_'.$count.'" style="display:none;">';
++count;
}
}
?>
I need to make $count in 2 position on the code is same. I got error with this code.
Thank you
Updated: Actually the code is not just as I give here. I tried with your code but doesnt work.
You can view full at http://www.codesend.com/view/7d58acb2b1c51149440984ec6568183d/ (pasw:123123)