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.
Result of php executing
Full code of MyCode.php
- <?php if ($rows = get_field('horizontal_tab')) { ?>
- <section class="grid-container horizontal__tabs" id="tabs">
- <div class="grid-x">
- <ul class="small-12 cell" data-tabs id="horizontal__tabs">
- <?php foreach ($rows as $index => $row) { ?>
- <?php if ($tab_title = $row['tab_title']) { ?>
- <?php $first_element = !$index ? true : false; ?>
- <li class="tabs-title <?php echo $first_element ? "is-active" : ""; ?>">
- <a href="#horizontal__tabs-<?php echo $index; ?>"
- aria-selected="<?php echo esc_attr($first_element); ?>"><?php echo $tab_title ?></a>
- </li>
- <?php } ?>
- <?php } ?>
- </ul>
- </div>
- <div data-tabs-content="horizontal__tabs">
- <?php foreach ($rows as $index => $row) { ?>
- <?php $first_element = !$index ? true : false; ?>
- <div class="tabs-panel <?php echo $first_element ? "is-active" : ""; ?>"
- id="horizontal__tabs-<?php echo $index; ?>">
- <div class="grid-x">
- <?php if ($tab_excerpt = $row['tab_excerpt']) { ?>
- <div class="medium-7 small-12 cell">
- <div class="horizontal__tabs__content">
- <div class="horizontal__tabs__content__excerpt">
- <?php echo $tab_excerpt; ?>
- </div>
- <?php if ($tab_button_link = $row['tab_link']) { ?>
- <a href="<?php echo esc_url($tab_button_link['url']); ?>"
- class="button button--dark button--middle"><?php echo $tab_button_link["title"]; ?></a>
- <?php } ?>
- </div>
- </div>
- <?php } ?>
- <?php if ($tab_sidebar = $row['tab_sidebar']) { ?>
- <div class="medium-4 small-12 cell horizontal__tabs__sidebar">
- <?php echo $tab_sidebar; ?>
- </div>
- <?php } ?>
- </div>
- </div>
- <?php } ?>
- </div>
- </section>
- <?php } ?>