This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
explode.php
71 lines (67 loc) · 1.48 KB
/
explode.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* explode.php
*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License, which
* is bundled with this package in the file LICENSE.txt.
*
* It is also available on the Internet at the following URL:
* https://raw.githubusercontent.com/auroraextensions/libxstring/master/LICENSE
*
* @copyright Copyright (C) 2020 Aurora Extensions <support@auroraextensions.com>
* @license MIT License
*/
if (!function_exists('bsexplode')) {
/**
* @param string $str
* @param int $limit
* @return array
*/
function bsexplode(
string $str,
int $limit = PHP_INT_MAX
): array {
return explode('\\', $str, $limit);
}
}
if (!function_exists('fsexplode')) {
/**
* @param string $str
* @param int $limit
* @return array
*/
function fsexplode(
string $str,
int $limit = PHP_INT_MAX
): array {
return explode('/', $str, $limit);
}
}
if (!function_exists('hyexplode')) {
/**
* @param string $str
* @param int $limit
* @return array
*/
function hyexplode(
string $str,
int $limit = PHP_INT_MAX
): array {
return explode('-', $str, $limit);
}
}
if (!function_exists('usexplode')) {
/**
* @param string $str
* @param int $limit
* @return array
*/
function usexplode(
string $str,
int $limit = PHP_INT_MAX
): array {
return explode('_', $str, $limit);
}
}