Standard PHP Library(SPL)というライブラリーには便利な関数が入っている。
2019.04.07
The Standard?PHP?Library (SPL) は、標準的な問題を解決するためのインターフェイスやクラスを集めたものですと公式ページに書かれている通り
便利な関数です。例としてspl_autoload_registerを紹介。
ぐぐるとどんな機能なのか書かれているので割愛してます。
<?php
spl_autoload_register(function($name){
include __DIR__ . DIRECTORY_SEPARATOR ."class" . DIRECTORY_SEPARATOR . $name . '.php';
});
$class_demo = new class_demo();
タグ
autoload, class, demo, DIR, DIRECTORY, function, include, Library, lt, name, new, php, register, SEPARATOR, SPL, Standard, The, インターフェイス, クラス, ため, ページ, もの, ライブラリー, 例, 便利, 公式, 割愛, 問題, 機能, 紹介, 解決, 通り, 関数,