Skip to content

Instantly share code, notes, and snippets.

@mehmetsarr
mehmetsarr / Yazı Kısaltma PHP
Created December 20, 2024 00:42
Yazı Kısaltma PHP
<?php
$aciklama = esc($ilan['ilan_aciklama']);
$echo = mb_substr($aciklama, 0, 50, "UTF-8");
$devam = "...";
echo $echo.$devam;
?>
@mehmetsarr
mehmetsarr / PHP foreach list limit
Created November 26, 2024 18:28
PHP foreach list limit
<?php
$i = 0;
foreach($data as $key => $row){
if(++$i > 2) break;
}
?>
@mehmetsarr
mehmetsarr / HTML sayfasını JS ile PDF olarak kaydedin
Created November 25, 2023 09:44
HTML sayfasını JS ile PDF olarak kaydedin
---index.html---
<div id="content">
<h1>Page Title</h1>
<p>Page contents as below</p>
</div><div id="page"></div>
<button id="submit">Export to PDF</button>
--------------------------------------------
@mehmetsarr
mehmetsarr / CodeIgniter 4 I sweetalert2 Kullanımı
Last active November 24, 2023 19:31
CodeIgniter 4 I sweetalert2 Kullanımı
</head> dan önce
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css"
id="theme-styles"
/>
yükleyin.
@mehmetsarr
mehmetsarr / Html botton print Code
Last active October 3, 2023 17:17
Html Print Button
<button class="btn btn-default" onclick="window.print()"><i class="fas fa-print"></i> Print</button>
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
Cİ4 de yeni versiyonda verilen hatanın çözümü
güncel ci4 indirin.
app\Config girin
Kint.php açın.
İçindeki tüm kodları kopyalayıp eski dosyanın içine atıp kaydedin.
# Disable directory browsing
Options -Indexes
# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
<?php
// Check PHP version.
$minPhpVersion = '7.4'; // If you update this, don't forget to update `spark`.
if (version_compare(PHP_VERSION, $minPhpVersion, '<')) {
$message = sprintf(
'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s',
$minPhpVersion,
PHP_VERSION
);
------------WORDPRESS---------------
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /