x-adam/tr-string

It provides auxiliary functions to solve the problem of Turkish characters when converting text to lowercase and uppercase in php.

v3.0.0 2020-12-15 20:17 UTC

This package is auto-updated.

Last update: 2024-04-27 22:51:43 UTC


README

Latest Stable Version Total Downloads Dependents License

68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f582d4164616d2f74722d737472696e672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572 StyleCI

Introduction

It provides auxiliary functions to solve the problem of Turkish characters when converting text to lowercase and uppercase in php.

Requirements

  1. PHP >=7.0
  2. PHP mbstring extension have to be loaded.

Other than that, this library has no requirements.

Install

$ composer require x-adam/tr-string:"~3"

Example Usage

include "./vendor/autoload.php";

# Make a string uppercase
echo tr_strtoupper('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 tr_strtolower('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 tr_ucfirst('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 tr_lcfirst('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 tr_ucwords('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.

License

This package is open source software licensed under the MIT license.