foxworn3365/listdictionaries

在PHP中使用数组和对象,类似于C#中的List和Dictionary

dev-main 2024-01-15 15:14 UTC

This package is auto-updated.

Last update: 2024-09-15 16:45:18 UTC


README

List<T>Dictionary<T, T> 在PHP中

安装

您可以在composer上安装它

composer require foxworn3365/listdictionaries

示例

列表

$list = PHPList::new("string|int", [
    "hello",
    "goodbye",
    "your name is owo"
]);

$list->where(fn($el) => strpos($el, "e"))->foreach(function ($el) {
    echo $el . PHP_EOL;
});

结果

hello
your name is owo