<?php

$returnHTML = '';
// Mendapatkan string JSON dari body permintaan
$jsonString = file_get_contents('php://input');

// Mendekode string JSON menjadi array PHP
$data = json_decode($jsonString, true);

// Menampilkan hasil dekode
// print_r($data);

if (isset($data['arrayParam'])) {

    $returnHTML = '<ol class="breadcrumb" style="margin-bottom: 0;">';
    $totalItems = count($data['arrayParam']);
    for ($i = 0; $i < $totalItems; $i++) {
        if ($i == $totalItems - 1) {
            $returnHTML .= '<li class="breadcrumb-item active" aria-current="page">'.$data['arrayParam'][$i]['title'].'</li>';
        } else {
            $returnHTML .= '<li class="breadcrumb-item"><a href="#">'.$data['arrayParam'][$i]['title'].'</a></li>';
        }
    }
    $returnHTML .= '</ol>';
   
    echo $returnHTML;
} else {
    $returnHTML = "Tidak ada data \n";
    echo $returnHTML;
}


?>