PHP code example of jackie-source / ash-entity

1. Go to this page and download the library: Download jackie-source/ash-entity 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/ */

    

jackie-source / ash-entity example snippets


// 检查字符串中是否包含某些字符串
Str::contains($haystack, $needles)

// 检查字符串是否以某些字符串结尾
Str::endsWith($haystack, $needles)

// 获取指定长度的随机字母数字组合的字符串
Str::random($length = 16)

// 字符串转小写
Str::lower($value)

// 字符串转大写
Str::upper($value)

// 获取字符串的长度
Str::length($value)

// 截取字符串
Str::substr($string, $start, $length = null)



// 确定给定值是否为数组可访问的。
Arr::accessible($value)

// 在数组中添加一个不存在的元素
Arr::add($array, $key, $value)

// 将数组的数组折叠成单个数组
Arr::collapse($array)

// 将一个数组划分为两个数组。一个带有键,另一个带有值
Arr::divide($array)

// 返回数组中第一个通过给定真值检验的元素
Arr::first($array, callable $callback = null, $default = null)

// 从给定数组中删除一个或多个数组项
Arr::forget(&$array, $keys)

// 检查数组中是否存在一个或多个项
Arr::has($array, $keys)