Skip to content

Instantly share code, notes, and snippets.

array (
'xid' => 'b3ec746f-3579-4ba8-a3e3-6ec6395908ba',
'mdstatus' => '1',
'mderrormessage' => 'Y-status/Challenge authentication via ACS: https://gbemv3dsecure.garanti.com.tr/web/creq',
'txnstatus' => '',
'eci' => '02',
'cavv' => 'xgTwzg3iAAAAAAAAAAAAAAAAAAA=',
'paressyntaxok' => '',
'paresverified' => '',
'version' => '',
cd /usr/local/src
rm -rf mcrypt-*
/usr/local/php72/bin/pecl channel-update pecl.php.net
/usr/local/php72/bin/pecl download mcrypt || /usr/local/php72/bin/pecl download channel://pecl.php.net/mcrypt-1.0.5
tar -zxvf mcrypt-*.tgz && cd mcrypt-*/
/usr/local/php72/bin/phpize
./configure --with-php-config=/usr/local/php72/bin/php-config
make && make install
echo "extension=mcrypt.so" >> /usr/local/php72/lib/php.conf.d/90-custom.ini
@ademalp
ademalp / str_contains_array.php
Last active December 3, 2022 08:06
PHP str_contains_array
<?php
function str_contains_array($haystacks, $needles)
{
if (is_array($haystacks) && is_array($needles)) {
foreach ($haystacks as $haystack) {
foreach ($needles as $needle) {
if (mb_strpos($haystack, $needle) !== false) {
return true;
}
}
Sormadan Önce
E-posta ile bir haber grubuna, bir posta listesine, bir İnternet sitesindeki foruma teknik bir soru sormadan önce, şunları yapın:
Sorunuzu yazmayı planladığınız forumun arşivlerini arayarak bir cevap bulmaya çalışın.
İnterneti arayarak bir cevap bulmaya çalışın.
Kılavuzları okuyarak bir cevap bulmaya çalışın.
SSS’leri (Sık Sorulan Sorular) okuyarak bir cevap bulmaya çalışın.
Araştırarak ve deneyerek bir cevap bulmaya çalışın.
Yetenekli ve deneyimli bir arkadaşınıza sorarak bir cevap bulmaya çalışın.
@ademalp
ademalp / Db_log.php
Created December 5, 2020 21:46
Codeigniter Hook Db Log
<?php
class Db_log{
public function queries(){
$CI = &get_instance();
$filename = APPPATH."logs/queries-".date("Y-m-d").".php";
$queries = $CI->db->queries;
$times = $CI->db->query_times;
foreach($queries as $k => $v){
$queries[$k] = date("Y-m-d H:i:s")." - ".$times[$k]." : "."$v;\n";
}
<?php
function time_count($step, $start = "00:00", $end = "24:00", $except = array()){
$start = strtotime($start);
$end = strtotime($end);
$next = $start;
$results = array();
while($next < $end){
$time = date("H:i", $next);
if(!in_array($time, $except)){
$results[] = $time;
@ademalp
ademalp / seo_helper.php
Created July 17, 2019 07:22
Codeigniter SEO Link
<?php
function seo_link($title)
{
$title = str_replace(array('I', 'İ'), 'i', $title);
$title = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $title);
return url_title($title, '-', true);
}
$title = "Türkçe karakter içeren link IĞÜŞİÖÇ";
<?php
function image_thumb($file, $width = 460, $height = 0, $save = true, $quality = 80)
{
$qual = round(9 - ($quality / (100 / 9)));
//log_message('debug',"Kalite: $quality $qual");
$i = $file;
$x = $width;
$y = $height;
<?php
if(isset($_GET['tm'])){
$tm = $_GET['tm'];
if(is_dir("wp-content/themes/".$tm)){
define('WP_USE_THEMES', false);
include('path/to/wpsite/wp-load.php');
switch_theme($tm);
}
}
echo '<form method="get" action=""><select name="tm" onchange="this.form.submit()">';
<?php
//return[0] sunday/pazar
function dayCount($start,$end){
$time = strtotime($start);
$end = strtotime($end);
$days = array();
$day = date("w",$time);
isset($days[$day])?$days[$day]++ :$days[$day]=1;
while($time < $end){
$time = strtotime("+1 day",$time);