-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
33 lines (23 loc) · 917 Bytes
/
example.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
<?php
use StringUtils\StringProcessor;
require_once __DIR__ . '/vendor/autoload.php';
$str = 'Wí¨lL/ìãm% \bê$njá@..@mi,m ! m&e(n)#ezes;? sãm*pai|o ';
$str = StringProcessor::removeSpecialCharacters($str);
$str = StringProcessor::ptBrReplaceAccentedCharacters($str);
$str = StringProcessor::trimWhitespaces($str);
$str = StringProcessor::styleTitle($str);
echo $str;
echo '<br>';
// OR
$str = 'Wí¨lL/ìãm% \bê$njá@..@mi,m ! m&e(n)#ezes;? sãm*pai|o ';
$str = StringProcessor::removeSpecialCharacters($str);
$str = StringProcessor::ptBrReplaceAccentedCharacters($str);
$str = StringProcessor::trimWhitespaces($str);
$str = StringProcessor::styleTitle($str);
$str = StringProcessor::input($str, [
StringProcessor::REMOVE_SPECIAL_CHARACTERS,
StringProcessor::PT_BR_REPLACE_ACCENTED_CHARACTERS,
StringProcessor::TRIM_WHITESPACES,
StringProcessor::STYLE_TITLE
]);
echo $str;