Skip to content

Instantly share code, notes, and snippets.

View msisaifu's full-sized avatar
🏠
Working from home

Mohammad Saiful Islam msisaifu

🏠
Working from home
  • dev @kws3
  • Chittagong,Bangladesh
View GitHub Profile
@msisaifu
msisaifu / index.php
Created November 11, 2018 18:26
Counts all the character of a string ascending order
<?php
$string = "hello!world!!! rrr";
echo "<pre>";
print_r(countChar($string));
echo "</pre>";
function countChar($string)
{
$explodeString = str_split(strtolower($string));
function reverseCase($string) {
$length = strlen($string);
for($i = 0; $i < $length; $i++) {
if(ctype_upper ($string[$i])) {
echo strtolower($string[$i]);
} else {
echo strtoupper($string[$i]);
}
}
}
function reverseCase($str) {
print strtolower($str) ^ strtoupper($str) ^ $str;
}
reverseCase('hello Bangladesh');
<?php
class Crud {
public $person = [];
function create($name){
array_push($this->person, $name);
}
function read($id){
echo "index number: {$id} {$this->person[$id]}";
<?php
class Crud {
public $person = [];
function create($array){
array_push($this->person,$array);
}
function read($id){
$index = $this->searchIndex($id);
<script context="module" lang="ts">
/**
* @type {import('@sveltejs/kit').Load}
*/
const posts = import.meta.glob('./contents/*.svx')
let body = []
for (const path in posts) {
body.push(posts[path]().then(({metadata}) => metadata))
class KitchenRenovationCalculator {
// ********************************************************************
// ***** For demo purposes here the price and factor are hardcoded *****
// ***** Once complete the functions SetFactor and setPrices will add all of those dynamically from your end *****
// ********************************************************************
setFactor(factors) { }
setPrices(prices) { }
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "students";
$table_name = 'student_info';
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "students";
$table_name = 'student_info';
$inserted = false;
$something_wrong = false;
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "students";
$table_name = 'student_info';
$inserted = false;
$something_wrong = false;
$id = $_GET['id'];
$rows = null;