MyCode - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of MyCode.php

  1. <?php if ($rows = get_field('horizontal_tab')) { ?>
  2.     <section class="grid-container horizontal__tabs" id="tabs">
  3.         <div class="grid-x">
  4.             <ul class="small-12 cell" data-tabs id="horizontal__tabs">
  5.                 <?php foreach ($rows as $index => $row) { ?>
  6.                     <?php if ($tab_title = $row['tab_title']) { ?>
  7.                         <?php $first_element = !$index true : false; ?>
  8.                         <li class="tabs-title <?php echo $first_element "is-active" : ""; ?>">
  9.                             <a href="#horizontal__tabs-<?php echo $index; ?>"
  10.                                aria-selected="<?php echo esc_attr($first_element); ?>"><?php echo $tab_title ?></a>
  11.                         </li>
  12.                     <?php } ?>
  13.                 <?php } ?>
  14.             </ul>
  15.         </div>
  16.         <div data-tabs-content="horizontal__tabs">
  17.             <?php foreach ($rows as $index => $row) { ?>
  18.                 <?php $first_element = !$index true : false; ?>
  19.                 <div class="tabs-panel <?php echo $first_element "is-active" : ""; ?>"
  20.                      id="horizontal__tabs-<?php echo $index; ?>">
  21.                     <div class="grid-x">
  22.                         <?php if ($tab_excerpt = $row['tab_excerpt']) { ?>
  23.                             <div class="medium-7 small-12 cell">
  24.                                 <div class="horizontal__tabs__content">
  25.                                     <div class="horizontal__tabs__content__excerpt">
  26.                                         <?php echo $tab_excerpt; ?>
  27.                                     </div>
  28.                                     <?php if ($tab_button_link = $row['tab_link']) { ?>
  29.                                         <a href="<?php echo esc_url($tab_button_link['url']); ?>"
  30.                                            class="button button--dark button--middle"><?php echo $tab_button_link["title"]; ?></a>
  31.                                     <?php } ?>
  32.                                 </div>
  33.                             </div>
  34.                         <?php } ?>
  35.                         <?php if ($tab_sidebar = $row['tab_sidebar']) { ?>
  36.                             <div class="medium-4 small-12 cell horizontal__tabs__sidebar">
  37.                                 <?php echo $tab_sidebar; ?>
  38.                             </div>
  39.                         <?php } ?>
  40.                     </div>
  41.                 </div>
  42.             <?php } ?>
  43.         </div>
  44.     </section>
  45. <?php } ?>
  46.  
  47.  
File Description
  • MyCode
  • PHP Code
  • 20 Nov-2019
  • 2.48 Kb
You can Share it: