I am trying to get two foreach loop by explode with two delimiters <> and "\n" but getting error. Warning: Invalid argument supplied for foreach()
Here is my code
<?php
$specifications = $scooter_meta->get_the_value('specifications');
$titles = explode('<>', $specifications);
$descs = explode("\n", $specifications);
echo '<dl>';
foreach($titles as $title => $descs){
echo '<dt>' . $title . '</dt>';
foreach($descs as $desc){
echo '<dd>' . $desc . '</dd>';
}
}
echo '</dl>';
?>
The value entering into textarea something like this Title here<>this is the first scooter ever made. In fact I would like to make it like
Title here 2<>another line for specification<title 1> here detail text
Thanks a lot
actually you should do something like this