1. Go to this page and download the library: Download 86dev/php-tools 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/ */
// You can use it to parse user input
BoolHelper::to_bool($_GET['user_input']);
// Or check a parameter
function test($param)
{
$param = BoolHelper::to_bool($param);
}
$value = "Some string with MANY Words";
StringHelper::split_words($value); // ['Some', 'string', 'with', 'MANY', 'Words']
StringHelper::capitalize($value); // Some string with many words
StringHelper::pascal_case($value); // SomeStringWithManyWords
StringHelper::camel_case($value); // someStringWithManyWords
StringHelper::snake_case($value); // some_string_with_many_words
StringHelper::upper_snake_case($value); // SOME_STRING_WITH_MANY_WORDS
StringHelper::capital_snake_case($value); // Some_String_With_Many_Words
StringHelper::kebab_case($value); // some-string-with-many-words
StringHelper::train_case($value); // Some-String-With-Many-Words
StringHelper::initial($value); // SSWMW
$timer = new Timer(true); // true to automatically start the timer
a_long_function();
$first_duration = $timer->duration(); // returns the time in seconds with milliseconds since the timer has been started until now
another_long_function();
$timer->stop(); // stops the timer
$final_duration = $timer->duration(); // returns the time since the timer has been started until it has been stopped.
a_third_long_function();
// calling $timer->duration() now will return the time since the timer has been started until it has been stopped, so the same as $final_duration.
echo $final_duration; // ex: 75.547682
echo $timer; // print m:ss.zzz, ex: 1:15.548