Hi!
I have little problem.
I need to check every row in another array, and if exist - do something.
This is my code:
PHP Code:
<?php $Sekcje = explode( ',', $Detail->SectionsPrefered ); ?>
<?php foreach ($SectionsList as $SectionOption): ?>
<div class="checkbox">
<?php if ( in_array( $SectionOption->Title , $Sekcje ) ): ?>
*
<?php endif ?>
<label>
<input type="checkbox" value="<?php echo $SectionOption->Title; ?>">
<?php echo $SectionOption->Title; ?>
</label>
</div>
<?php endforeach ?>
It's display only one '*', but must display for 3 rows (Section1, Section2, Section3)
This is the array $Sekcje:
PHP Code:
array(3) {
[0]=> string(8) "Section1"
[1]=> string(9) " Section2"
[2]=> string(9) " Section3"
}
Where is the problem?