PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Ogbemudia Osayawe   PHP JSON Response Class   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP JSON Response Class
Generate a HTTP request response in JSON format
Author: By
Last change:
Date: 4 years ago
Size: 324 bytes
 

Contents

Class file image Download
<?php
require_once __DIR__ ."/vendor/autoload.php";

use
Devscreencast\ResponseClass\JsonResponse;

$student = array(
   
'name' => 'John Doe',
   
'course' => 'Software Engineering',
   
'level' => '200',
   
'collections' => ['books' => 'Intro to UML', 'music' => 'rap']
);

new
JsonResponse('unauthorized', '', $student);