PHP code example of marjovanlier / stringmanipulation
1. Go to this page and download the library: Download marjovanlier/stringmanipulation 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/ */
marjovanlier / stringmanipulation example snippets
use MarjovanLier\StringManipulation\StringManipulation;
$result = StringManipulation::searchWords('Hello_World');
echo $result; // Outputs: 'hello world'
use MarjovanLier\StringManipulation\StringManipulation;
$fixedName = StringManipulation::nameFix('mcdonald');
echo $fixedName; // Outputs: 'McDonald'
use MarjovanLier\StringManipulation\StringManipulation;
$result = StringManipulation::searchWords('Hello_World');
echo $result; // Outputs: 'hello world'
use MarjovanLier\StringManipulation\StringManipulation;
$fixedName = StringManipulation::nameFix('de souza');
echo $fixedName; // Outputs: 'De Souza'
use MarjovanLier\StringManipulation\StringManipulation;
$ansiString = StringManipulation::utf8Ansi('Über');
echo $ansiString; // Outputs: 'Uber'
use MarjovanLier\StringManipulation\StringManipulation;
$normalisedString = StringManipulation::removeAccents('Crème Brûlée');
echo $normalisedString; // Outputs: 'Creme Brulee'
use MarjovanLier\StringManipulation\StringManipulation;
$isValidDate = StringManipulation::isValidDate('2023-02-29', 'Y-m-d');
echo $isValidDate ? 'Valid' : 'Invalid'; // Outputs: 'Invalid'
use MarjovanLier\StringManipulation\StringManipulation;
$originalString = 'Crème Brûlée';
$processedString = StringManipulation::nameFix(StringManipulation::utf8Ansi(StringManipulation::removeAccents($originalString)));
echo $processedString; // Outputs: 'Creme Brulee'