PHP code example of code4recovery / spec

1. Go to this page and download the library: Download code4recovery/spec library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

code4recovery / spec example snippets


$spec::getLanguages();

// this returns:
[
	'en' => 'English',
    'es' => 'Español',
    'fr' => 'Français',
    'ja' => '日本語',
    'sv' => 'Svenska',
    'sk' => 'Slovenčina',
];

$spec::getAllTypes();

// this returns (truncated):
{
  "11": {
    "en": "11th Step Meditation",
    "es": "Meditación del Paso 11",
    "fr": "Méditation sur la 11e Étape",
    "ja": "ステップ11 黙想",
    "sv": "11th Stegs Meditation",
    "sk": "Meditácia 11. kroku"
  },
   "12x12": {
    "en": "12 Steps & 12 Traditions",
    "es": "12 Pasos y 12 Tradiciones",
    "fr": "12 Étapes et 12 Traditions",
    "ja": "12のステップと12の伝統",
    "sv": "12 Steg & 12 Traditioner",
    "sk": "12 Krokov & 12 Tradícií"
  },
  ...
};

$spec::getTypesByLanguage('en');

// returns (truncated):
[
    "11" => "11th Step Meditation"
    "12x12" => "12 Steps & 12 Traditions"
    "A" => "Secular"
    "ABSI" => "As Bill Sees It"
    ...
];