Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php // Creating a class for the platform class TravelPlatform { private $dest..

Decoded Output download

<?php 
 
// Creating a class for the platform 
  class TravelPlatform { 
    private $destinations = array(); 
 
    // Method to add destinations 
    public function addDestination($destination, $accommodations) { 
      $this->destinations[$destination] = $accommodations; 
    } 
 
    // Method to get accommodations based on destination 
    public function getAccommodations($destination) { 
      if(array_key_exists($destination, $this->destinations)) { 
        return $this->destinations[$destination]; 
      } else { 
        return "No accommodations found for this destination."; 
      } 
    } 
 
    // Method to book accommodations 
    public function bookAccommodation($destination, $accommodation) { 
      if(array_key_exists($destination, $this->destinations)) { 
        $accommodations = $this->destinations[$destination]; 
        $key = array_search($accommodation, $accommodations); 
        if($key !== false) { 
          unset($accommodations[$key]); 
          $this->destinations[$destination] = $accommodations; 
          return "Booking successful!"; 
        } else { 
          return "Accommodation not found."; 
        } 
      } else { 
        return "Destination not found."; 
      } 
    } 
  } 
?>

Did this file decode correctly?

Original Code

<?php

// Creating a class for the platform
  class TravelPlatform {
    private $destinations = array();

    // Method to add destinations
    public function addDestination($destination, $accommodations) {
      $this->destinations[$destination] = $accommodations;
    }

    // Method to get accommodations based on destination
    public function getAccommodations($destination) {
      if(array_key_exists($destination, $this->destinations)) {
        return $this->destinations[$destination];
      } else {
        return "No accommodations found for this destination.";
      }
    }

    // Method to book accommodations
    public function bookAccommodation($destination, $accommodation) {
      if(array_key_exists($destination, $this->destinations)) {
        $accommodations = $this->destinations[$destination];
        $key = array_search($accommodation, $accommodations);
        if($key !== false) {
          unset($accommodations[$key]);
          $this->destinations[$destination] = $accommodations;
          return "Booking successful!";
        } else {
          return "Accommodation not found.";
        }
      } else {
        return "Destination not found.";
      }
    }
  }
?>

Function Calls

None

Variables

None

Stats

MD5 69b7e0bd2bd52657d951f9a0c4bc0a1e
Eval Count 0
Decode Time 46 ms