PHP code example of x-laravel / str-tr-extend
1. Go to this page and download the library: Download x-laravel/str-tr-extend 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/ */
x-laravel / str-tr-extend example snippets
# Make a string uppercase
echo Str::trUpper('Yalnızlık insanlara çok şey öğretirmiş. Ama sen gitme cahil kalayım.');
# Result: YALNIZLIK İNSANLARA ÇOK ŞEY ÖĞRETİRMİŞ. AMA SEN GİTME CAHİL KALAYIM.
# Make a string lowercase
echo Str::trLower('YALNIZLIK İNSANLARA ÇOK ŞEY ÖĞRETİRMİŞ. AMA SEN GİTME CAHİL KALAYIM.');
# Result: yalnızlık insanlara çok şey öğretirmiş. ama sen gitme cahil kalayım.
# Make a string's first character uppercase
echo Str::trUcFirst('yalnızlık insanlara çok şey öğretirmiş. ama sen gitme cahil kalayım.');
# Result: Yalnızlık insanlara çok şey öğretirmiş. ama sen gitme cahil kalayım.
# Make a string's first character lowercase
echo Str::trLcFirst('Yalnızlık insanlara çok şey öğretirmiş. ama sen gitme cahil kalayım.');
# Result: yalnızlık insanlara çok şey öğretirmiş. ama sen gitme cahil kalayım.
# Uppercase the first character of each word in a string
echo Str::trUcWords('yalnızlık insanlara çok şey öğretirmiş. ama sen gitme cahil kalayım.');
# Result: Yalnızlık İnsanlara Çok Şey Öğretirmiş. Ama Sen Gitme Cahil Kalayım.