PHP Classes

File: Functions/convert_toml_to_json.php

Recommend this page to a friend!
  Classes of ASCOOS CMS   converter-toml   Functions/convert_toml_to_json.php   Download  
File: Functions/convert_toml_to_json.php
Role: Example script
Content type: text/plain
Description: Example script
Class: converter-toml
Converts files of various formats to and from TOML
Author: By
Last change:
Date: 28 days ago
Size: 1,866 bytes
 

Contents

Class file image Download
<?php
/**
 * __ _ ___ ___ ___ ___ ___ ____ _ __ ___ ___
 * / _` |/ / / __/ _ \ / _ \ / / / __/| '_ ` _ \ / /
 * | (_| |\ \| (_| (_) | (_) |\ \ | (__ | | | | | |\ \
 * \__,_|/__/ \___\___/ \___/ /__/ \___\|_| |_| |_|/__/
 *
 *
 ************************************************************************************
 * @ASCOOS-NAME : ASCOOS CMS 25' *
 * @ASCOOS-VERSION : 25.0.0 *
 * @ASCOOS-CATEGORY : Framework (Frontend and Administrator Side) *
 * @ASCOOS-CREATOR : Drogidis Christos *
 * @ASCOOS-SITE : www.ascoos.com *
 * @ASCOOS-LICENSE : [Commercial] http://docs.ascoos.com/lics/ascoos/AGL.html *
 * @ASCOOS-COPYRIGHT : Copyright (c) 2007 - 2025, AlexSoft Software. *
 ************************************************************************************
 *
 * @package : ASCOOS FRAMEWORK 25'
 * @subpackage : Examples for TArrayHandler.
 * @source : Functions\convert_toml_to_json.php
 * @fileNo :
 * @version : 25.0.0
 * @build : 10992
 * @created : 2025-01-27 07:00:00 UTC+2
 * @updated :
 * @author : Drogidis Christos
 * @authorSite : www.alexsoft.gr
 * @license : AGL-F
 *
 * @since PHP 8.2.0
 */

use ASCOOS\FRAMEWORK\Kernel\Arrays\TArrayHandler;

$objArray = new TArrayHandler();

function
convert_toml_to_json(string $filename): string
{
    global
$objArray;

   
$objArray->fromTOML($filename);

    return
$objArray->toJSON();
}

echo
convert_toml_to_json('config.toml');

$objArray->Free($objArray);
?>