@@ -109,7 +109,7 @@ $array = array_except_value($array, ['bar', 'baz']);
109
109
110
110
# ### `multiarray_set()`
111
111
112
- Set a value for each item of the multidimensional array using " dot" notation:
112
+ Set value for each item of the multidimensional array using " dot" notation:
113
113
114
114
` ` ` php
115
115
$array = [
@@ -129,7 +129,7 @@ multiarray_set($array, 'details.country', 'Germany');
129
129
130
130
# ### `multiarray_sort_by()`
131
131
132
- Sort the multidimensional array by few fields:
132
+ Sort the multidimensional array by several fields:
133
133
134
134
` ` ` php
135
135
$array = [
@@ -171,15 +171,15 @@ $sorted = multiarray_sort_by($array, 'name', SORT_ASC, 'model', SORT_DESC);
171
171
172
172
# ### `call_in_background()`
173
173
174
- Call artisan console command in the background. Code execution continues immediately, without waiting for results.
174
+ Call the given artisan console command in background. Code execution continues immediately, without waiting for results.
175
175
176
176
` ` ` php
177
177
call_in_background(' report' );
178
178
179
179
// " php artisan report" would be called in background
180
180
` ` `
181
181
182
- Optional ` before` and ` after` sub-commands can be set as a second and third parameter :
182
+ Optional ` before` and ` after` sub-commands could be provided :
183
183
184
184
` ` ` php
185
185
call_in_background(' report:monthly subscriptions' , ' sleep 0.3' );
@@ -191,7 +191,7 @@ call_in_background('report:monthly subscriptions', 'sleep 0.3');
191
191
192
192
# ### `db_is_sqlite()`
193
193
194
- Check if the default database connection driver is ` sqlite` or not:
194
+ Check whether the default database connection driver is ` sqlite` or not:
195
195
196
196
` ` ` php
197
197
if (db_is_sqlite()) {
@@ -201,7 +201,7 @@ if (db_is_sqlite()) {
201
201
202
202
# ### `db_is_mysql()`
203
203
204
- Check if the default database connection driver is ` mysql` or not:
204
+ Check whether the default database connection driver is ` mysql` or not:
205
205
206
206
` ` ` php
207
207
if (db_is_mysql()) {
@@ -211,7 +211,7 @@ if (db_is_mysql()) {
211
211
212
212
# ### `db_mysql_now()`
213
213
214
- Get database datetime, using ` mysql ` connection :
214
+ Get the current MySQL datetime :
215
215
216
216
` ` ` php
217
217
$now = db_mysql_now ();
@@ -221,7 +221,7 @@ $now = db_mysql_now();
221
221
222
222
# ### `db_mysql_variable()`
223
223
224
- Get the value of specified ` mysql ` variable, or ` false ` if the variable doesn ' t exist :
224
+ Get value of the specified MySQL variable :
225
225
226
226
` ` ` php
227
227
$hostname = db_mysql_variable(' hostname' );
@@ -233,7 +233,7 @@ $hostname = db_mysql_variable('hostname');
233
233
234
234
# ### `to_default_timezone()`
235
235
236
- Convert passed datetime string to the default timezone, which is `app.timezone` config setting :
236
+ Convert datetime to the default timezone ( ` app.timezone` config parameter) :
237
237
238
238
` ` ` php
239
239
$date = to_default_timezone(' 2017-02-28T14:05:01Z' );
@@ -257,7 +257,7 @@ $backtrace = backtrace_as_string();
257
257
258
258
# ### `minimized_backtrace_as_string()`
259
259
260
- Get minimized backtrace as a string:
260
+ Get minimized backtrace, as a string:
261
261
262
262
` ` ` php
263
263
$backtrace = minimized_backtrace_as_string ();
@@ -271,7 +271,7 @@ $backtrace = minimized_backtrace_as_string();
271
271
272
272
# ### `is_email()`
273
273
274
- Check if the specified string is a valid email address or not:
274
+ Check whether the given string is an email address or not:
275
275
276
276
` ` ` php
277
277
$isEmail = is_email(' [email protected] ' );
281
281
282
282
# ### `to_rfc2822_email()`
283
283
284
- Convert addresses data to [RFC 2822](http://www. faqs.org/rfcs/rfc2822.html) string, suitable for PHP [mail()](http ://ua2. php.net/manual/en/function.mail.php) function:
284
+ Convert addresses data to [RFC 2822](http://faqs.org/rfcs/rfc2822.html) string, suitable for PHP [mail()](https ://php.net/manual/en/function.mail.php) function:
285
285
286
286
` ` ` php
287
287
$address = to_rfc2822_email([
@@ -292,7 +292,7 @@ $address = to_rfc2822_email([
292
292
293
293
` ` `
294
294
295
- Also supports simplified syntax for single address item :
295
+ Also supports simplified syntax for single address:
296
296
297
297
` ` ` php
298
298
$address = to_rfc2822_email([' address' => ' [email protected] ' , ' name' => ' John Doe' ]);
@@ -302,7 +302,7 @@ $address = to_rfc2822_email(['address' => '
[email protected] ', 'name' => 'Joh
302
302
303
303
# ### `to_swiftmailer_emails()`
304
304
305
- Convert addresses data to format, which is suitable for [SwiftMailer library](http ://swiftmailer.org/docs/messages.html):
305
+ Convert addresses data to [SwiftMailer-suitable format](https ://swiftmailer.org/docs/messages.html):
306
306
307
307
` ` ` php
308
308
$addresses = to_swiftmailer_emails([
@@ -313,7 +313,7 @@ $addresses = to_swiftmailer_emails([
313
313
314
314
` ` `
315
315
316
- Also supports simplified syntax for single address item :
316
+ Also supports simplified syntax for single address:
317
317
318
318
` ` ` php
319
319
$address = to_swiftmailer_emails([' address' => ' [email protected] ' , ' name' => ' John Doe' ]);
@@ -325,7 +325,7 @@ $address = to_swiftmailer_emails(['address' => '
[email protected] ', 'name' =>
325
325
326
326
# ### `relative_path()`
327
327
328
- Get the relative path for two directories :
328
+ Get relative path for the given folders :
329
329
330
330
` ` ` php
331
331
$path = relative_path(' /var/www/htdocs' , ' /var/www/htdocs/example' )
@@ -345,7 +345,7 @@ $path = relative_path('/var/www/htdocs/example/public/../../', '/var/')
345
345
346
346
# ### `get_dump()`
347
347
348
- Get nicely formatted string representation of the variable, using [Symfony VarDumper Component](http ://symfony.com/doc/current/components/var_dumper/introduction.html):
348
+ Get nicely formatted string representation of the variable, using [Symfony VarDumper Component](https ://symfony.com/doc/current/components/var_dumper/introduction.html):
349
349
350
350
` ` ` php
351
351
$array = [
@@ -368,7 +368,7 @@ $dump = get_dump($array);
368
368
369
369
# ### `format_bytes()`
370
370
371
- Format bytes into kilobytes, megabytes, gigabytes or terabytes, with specified precision :
371
+ Format bytes into kilobytes, megabytes, gigabytes or terabytes:
372
372
373
373
` ` ` php
374
374
$formatted = format_bytes(3333333);
@@ -407,15 +407,15 @@ $formatted = format_xml('<?xml version="1.0"?><root><task priority="low"><to>Joh
407
407
408
408
# ### `is_json()`
409
409
410
- Check if specified variable is a valid JSON-encoded string or not:
410
+ Check whether the given value is a valid JSON-encoded string or not:
411
411
412
412
` ` ` php
413
413
$isJson = is_json(' {"foo":1,"bar":2,"baz":3}' );
414
414
415
415
// true
416
416
` ` `
417
417
418
- It can return decoded JSON if you pass the second argument as `true` :
418
+ It returns decoded JSON if you pass ` true ` as a second argument :
419
419
420
420
` ` ` php
421
421
$decoded = is_json(' {"foo":1,"bar":2,"baz":3}' , true);
@@ -427,7 +427,7 @@ $decoded = is_json('{"foo":1,"bar":2,"baz":3}', true);
427
427
428
428
# ### `str_lower()`
429
429
430
- Convert string to lowercase, using `mb_strtolower` in `UTF-8` encoding:
430
+ Convert string to lowercase, assuming it ' s using the `UTF-8` encoding:
431
431
432
432
```php
433
433
$lower = str_lower(' TeSt' );
@@ -437,7 +437,7 @@ $lower = str_lower('TeSt');
437
437
438
438
#### `str_upper()`
439
439
440
- Convert string to uppercase, using `mb_strtoupper` in `UTF-8` encoding:
440
+ Convert string to uppercase, assuming it ' s using the ` UTF-8` encoding:
441
441
442
442
` ` ` php
443
443
$upper = str_upper(' TeSt' );
@@ -449,7 +449,7 @@ $upper = str_upper('TeSt');
449
449
450
450
# ### `is_windows_os()`
451
451
452
- Check if PHP is running on Windows OS or not:
452
+ Check whether the operating system is Windows or not:
453
453
454
454
` ` ` php
455
455
$isWindowsOs = is_windows_os ();
@@ -461,7 +461,7 @@ $isWindowsOs = is_windows_os();
461
461
462
462
# ### `xml_to_array()`
463
463
464
- Convert XML string to the array:
464
+ Convert XML string to array:
465
465
466
466
` ` ` php
467
467
$array = xml_to_array(' <?xml version="1.0"?>
@@ -495,11 +495,11 @@ $array = xml_to_array('<?xml version="1.0"?>
495
495
// ]
496
496
` ` `
497
497
498
- Alternatively, you can pass an instance of a `SimpleXMLElement` object, to get the same results .
498
+ Alternatively, you can pass an instance of ` SimpleXMLElement` as a first argument .
499
499
500
500
# ### `array_to_xml()`
501
501
502
- Convert array to XML string using [spatie/array-to-xml](https://github.com/spatie/array-to-xml) package :
502
+ Convert array to XML string:
503
503
504
504
` ` ` php
505
505
$array = [
0 commit comments