PHP Türkçe Karakter Fonksiyonları

strtoupper

$harf = ‘abcd ğüşiöçı’;

echo tr_strtoupper($harf);

function tr_strtoupper($text)
{
$search=array(“ç”,”i”,”ı”,”ğ”,”ö”,”ş”,”ü”);
$replace=array(“Ç”,”İ”,”I”,”Ğ”,”Ö”,”Ş”,”Ü”);
$text=str_replace($search,$replace,$text);
$text=strtoupper($text);
return $text;
}


strtolower

$cumle = ‘Iğdır ve İstanbul BEŞİKTAŞ’;
echo tr_strtolower($cumle);

function tr_strtolower($text)
{
$search=array(“Ç”,”İ”,”I”,”Ğ”,”Ö”,”Ş”,”Ü”);
$replace=array(“ç”,”i”,”ı”,”ğ”,”ö”,”ş”,”ü”);
$text=str_replace($search,$replace,$text);
$text=strtolower($text);
return $text;
}


strreplace

$urunBaslik = ‘White-B Şarj Edilebilir Diş Fırçası Vitality 3D D12’;
echo tr_str_replace($urunBaslik);

function tr_str_replace($text)
{
$aranan = [‘Ç’,’ç’,’Ğ’,’ğ’,’ı’,’İ’,’Ö’,’ö’,’Ş’,’ş’,’Ü’,’ü’,’ ‘];
$yerine = [‘C’,’c’,’G’,’g’,’i’,’I’,’O’,’o’,’S’,’s’,’U’,’u’,’-‘];
$seoBaslik = str_replace($aranan, $yerine, $urunBaslik);
return $seoBaslik;
}

git workflow ubuntu www

on ubuntu:

install git

create repo (home git repos)

make .git repo and sub files’ group and owner -> git

in repo hook folder, create “post-receive” and paste this:

#!/bin/sh
git –work-tree=/var/www/[cloned-git-folder] –git-dir=/home/git/repos/[repo-name].git checkout -f

(above work-tree and git-dir commands starts with two – sign)

clone git in var/www

make cloned www folder group -> www-data, owner -> git

connect ssh repo with git user because remote git repo post-receive file’s owner and group is git user


in usr/local/bin create command file like “pull-reponame”

paste this:

#!/bin/sh
cd /var/www/[cloned-repo-folder]
git stash && git pull

you can make owner any user and group git

add execute permission to git group

add any user to git group to allow running this command shortcut

bootstrap 3 latest download & grunt ops

Install C

bower install bootstrap
or
npm install bootstrap@3
or
composer require twbs/bootstrap

  • install npm
  • npm install -g grunt-cli.
  • cd /bootstrap root folder
  • npm install

Available Grunt commands

grunt dist (Just compile CSS and JavaScript)

Regenerates the /dist/ directory with compiled and minified CSS and JavaScript files. As a Bootstrap user, this is normally the command you want.

grunt watch (Watch)

Watches the Less source files and automatically recompiles them to CSS whenever you save a change.

grunt test (Run tests)

Runs JSHint and runs the QUnit tests headlessly in PhantomJS.

grunt docs (Build & test the docs assets)

Builds and tests CSS, JavaScript, and other assets which are used when running the documentation locally via bundle exec jekyll serve.

grunt (Build absolutely everything and run tests)