downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

spl_autoload_functions> <spl_autoload_call
[edit] Last updated: Fri, 25 May 2012

view this page in

spl_autoload_extensions

(PHP 5 >= 5.1.2)

spl_autoload_extensionsspl_autoload 用のデフォルトの拡張子を登録し、それを返す

説明

string spl_autoload_extensions ([ string $file_extensions ] )

この関数は、__autoload() 用の代替関数である spl_autoload() が使用するファイル拡張子を変更したり調べたりします。

パラメータ

file_extensions

引数なしでコールした場合は、現在の拡張子一覧をカンマ区切りで返します。 ファイル拡張子を変更するには、 新しい拡張子一覧をカンマ区切り文字列で表したものを引数に指定して、 この関数を実行します。

返り値

spl_autoload() のデフォルト拡張子の一覧をカンマ区切り形式で返します。



add a note add a note User Contributed Notes spl_autoload_extensions
Jeremy Cook 03-Sep-2010 03:46
A quick note for anyone using this function to add their own autoload extensions. I found that if I included a space in between the different extensions (i.e. '.php, .class.php') the function would not work. To get it to work I had to remove the spaces between the extensions (ie. '.php,.class.php'). This was tested in PHP 5.3.3 on Windows and I'm using spl_autoload_register() without adding any custom autoload functions.

Hope that helps somebody.
Kerry Kobashi 12-May-2010 02:50
Extensions include the period. For example:

spl_autoload_extensions(".inc, .php, .lib, .lib.php ");

 
show source | credits | stats | sitemap | contact | advertising | mirror sites