I have this PHP code:
<?
$shopsite_templates = array(
array('tmpl_1', 'Template 1'),
array('tmpl_2', 'Template 2'),
array('tmpl_3', 'Template 3'),
array('tmpl_4', 'Template 4')
);
?>
And a html and php code that created a list of those templates:
<? foreach ($shopsite_templates as $value) {?>
<? for ($i = 0; $i < count($shopsite_templates); $i++){ ?>
<div style="float: left;">
<div id="reg_web_tmp_box">
<div class="temp_name"><strong><? echo $shopsite_templates[$i][1]; ?></strong>
</div>
<div class="select">
<div class="reg_selectradio"><input name="edittmpl" type="radio" id="tmpl_<? echo $i; ?>" value="<? echo $shopsite_templates[$i][0]; ?>"<? if ($formitems['tmpl'] == $shopsite_templates[$i][0]) { ?> checked="checked"<? }; ?> /> <? echo $langdata['registshop_temp_select']; ?></div>
</div>
<div class="clear"></div>
</div>
</div>
<? }; ?>
<? }; ?>
Everything is working fine, but I want for example tmpl_4 (template 4) not to be in the list. I cannot delete it, it must figure in $shopsite_templates but not in this list.
I need this because I have several Free templates that i offer to my costumers, and i have some templates that i dont want to offer them, but i need to use it for further business.
I hope you gurus will understand my question. Please help me!
You can have items you don’t want displayed in array like this:
And then in for loop just do: