Show divs based on the amount of arrays

后端 未结 2 1782
醉话见心
醉话见心 2021-01-20 14:43

Here is my function

function yyy_hero_image_option_callback() {
$hero_options = get_option( \'hero_options\' ); 
$count=count($hero_options);
$totalimg=$coun         


        
2条回答
  •  心在旅途
    2021-01-20 14:52

    try:

    function yyy_hero_image_option_callback() {
    
      $hero_options = get_option( 'hero_options' ); 
      $i=1;
      $html = '
    '; foreach($hero_options as $key => $values){ if (strpos($key, 'zzz')) { $html .= '
    '; $html .= '
    -
    '; $html .= '
    '; $i++; } } $html .= '
    Add an Image
    '; echo $html; }

提交回复
热议问题