1528 gün önce Metin kısaltırken uygun yerde kesme
sorusunu cevapladı.
function firstXChars($string, $chars = 100)
{
preg_match("@^.{0,$chars}.*?\b@iu", $string, $matches);
return $matches[0];
}
1528 gün önce JS Genel Fonksiyon Oluşturma
sorusunu cevapladı.
<!doctype html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
display: flex;
}
</style>
</head>
<body>
<?php
$images = [
'https://www.rastgeleresim.com/images/turkish-cuisine-480547_1280.jpg',
'https://www.rastgeleresim.com/images/traffic-3612474_1280.jpg',
'https://www.rastgeleresim.com/images/take-532097_1280.jpg',
'https://www.rastgeleresim.com/images/tailor-2778734_1280.jpg',
'https://www.rastgeleresim.com/images/white-cat-4134639_1280.jpg',
'https://www.rastgeleresim.com/images/blue-mosque-908510_1280.jpg'
];
foreach ($images as $image) { ?>
<div class="fea-img">
<img src=""><br>
<input type="text" value="<?= $image ?>" readonly><br>
<button class="goster">Göster</button>
</div>
<?php }
?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(function () {
$(".goster").on("click", function () {
$(this).siblings("img").attr({
src: $(this).siblings("input").val(),
width: 250,
height: 250
})
})
})
</script>
</body>
</html>
1528 gün önce basit olduğunu düşündüğüm ama çözemediğim jquery sorusu
sorusunu cevapladı.
1529 gün önce PROTOTÜRK EKSİKLİKLERİ [GÜNCEL]
sorusunu cevapladı.
@rephp7 Aynen hocam ben de o şekil yapıyorum ama yine de uğraştırıyor
1529 gün önce Datatable Toplama İşlemi
sorusunu cevapladı.
$('#tablo').DataTable({
footerCallback: function () {
let api = this.api(),
intVal = (i) => typeof i === 'string' ?
i.replace(/[TL,]/g, '') * 1 :
typeof i === 'number' ? i : 0,
total1 = api
.column(4)
.data()
.reduce((a, b) => {
return intVal(a) + intVal(b);
}, 0),
total2 = api
.column(5)
.data()
.reduce((a, b) => {
return intVal(a) + intVal(b);
}, 0),
pageTotal1 = api
.column(4, {page: 'current'})
.data()
.reduce((a, b) => {
return intVal(a) + intVal(b);
}, 0),
pageTotal2 = api
.column(5, {page: 'current'})
.data()
.reduce((a, b) => {
return intVal(a) + intVal(b);
}, 0)
$(api.column(5).footer()).html(`Bu sayfa: ${pageTotal1.toFixed(2)} TL
Toplam: ${total1.toFixed(2)} TL`);
$(api.column(6).footer()).html(`Bu sayfa: ${pageTotal2.toFixed(2)} TL
Toplam: ${total2.toFixed(2)} TL`);
}
})
1529 gün önce Session Dizisine Yeni Eleman Ekleme
sorusunu cevapladı.
<?php
class Session
{
private static $SessionStart = false;
public static function sessionStart()
{
if(!self::$SessionStart){
session_start();
self::$SessionStart = true;
}
}
public static function exist($name): bool
{
if(isset($_SESSION[$name]))
return true;
return false;
}
public static function createSession(string $name, $data): bool
{
if(!self::exist($name)) {
$_SESSION[$name] = $data;
return true;
}
else return false;
}
public static function updateSession(string $name, string $key, $data): bool
{
if (self::exist($name))
{
if (is_array($_SESSION[$name]))
{
$_SESSION[$name][$key] = $data;
return true;
} else return false;
} else return false;
}
public static function removeSession(string $name, $multidimensional = false, $key = ''): bool
{
if (exist($name))
{
if (!$multidimensional) {
unset($_SESSION[$name]);
return true;
} else {
if (is_array($_SESSION[$name])) {
if (array_key_exists($key, $_SESSION[$name])) {
unset($_SESSION[$name][$key]);
} else return false;
} else return false;
}
} else return false;
}
}
Not: Sadece iki boyutlu dizide çalışır
1530 gün önce PHPMailer mail göndermiyor.
sorusunu cevapladı.
Bu yazıyı bir okuyup öyle deneyin
1532 gün önce Localhost dosyalarımın üzerinden yaptığım değişiklikler sayfayı yenileyince gözükmüyor
sorusunu cevapladı.
CTRL + F5
1535 gün önce JScriptte function ve const farkı
sorusunu cevapladı.
Bu sayfadaki bilgiler işinize yarayabilir.
1535 gün önce Javascript'te Input'un Değerini Alma Problemi
sorusunu cevapladı.
Mesela bunun gibi bir şey yapabilirsiniz
https://codepen.io/Elessar61/pen/NWgLwLe