Skip to content

Instantly share code, notes, and snippets.

View PatricNox's full-sized avatar
🔰
Open-Source enthusiast

PatricNox PatricNox

🔰
Open-Source enthusiast
View GitHub Profile
@PatricNox
PatricNox / PHP: Remove last part of String
Created August 9, 2019 09:11
PHP function that removes the last part of a string.
/**
* Remove the last part of a string.
*
* This function removes the last part of a string, conditioned on spaces
* inbetween the parts. Like words, in a sentence.
*
* @param String $string The string.
**/
function str_remove_lastpart($string) {
$string_parts = explode(' ',$string);
@PatricNox
PatricNox / boss_noth.cpp
Created June 21, 2019 11:59
TrinityCore 3.3.5 Naxxramas BossScript
/*
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@PatricNox
PatricNox / index.php
Last active May 21, 2019 19:26
Example: Checkbox with values PHP
<?php
// If they selected the first checkbox!
if (isset($_POST['checkbox_1']) {
echo "You selected: $_POST['checkbox_1']";
}
// If they selected the second checkbox!
if (isset($_POST['checkbox_1'])) {
echo "You selected: $_POST['checkbox_1']";