Mysql
 sql >> Database >  >> RDS >> Mysql

Come inviare elementi HTML tramite JSON usando PHP?

devi rimuovere i tag html.

try{
    $query =  $this->pdo->prepare("SELECT * FROM bookings WHERE TourID = ? AND dTourDate = ? and Status NOT LIKE 'Cancelled'");
    $query->execute(array($tourId,$date));
    $result = $query->fetchAll(PDO::FETCH_ASSOC);
    $resultStrip = json_decode(strip_tags(json_encode($result)), true);
    if(count($resultStrip )<1)
        $this->error("'Booking' Not Found.",$this->errCode->sqlNotBooking);
    $this->success("Booking List Success.",(array) $resultStrip);
}

spero che ti aiuti.