Hey,
i have this code to add a class to the ul element. But how can i add a class to the li element too?
<?php
$liste = $page->liste();
$liste_ul = preg_replace('/<ul>/', '<ul class="classname">', $liste);
?>
<?= $liste_ul; ?>
Hey,
i have this code to add a class to the ul element. But how can i add a class to the li element too?
<?php
$liste = $page->liste();
$liste_ul = preg_replace('/<ul>/', '<ul class="classname">', $liste);
?>
<?= $liste_ul; ?>
preg_replace()
accepts an array of patterns and values to replace with, no just single string