Skip to content

Instantly share code, notes, and snippets.

<?php
class palindrome
{
private static $caseSensitive = false;
static function isPalindrome($word)
{
$reversedWord = strrev($word);
if (!self::$caseSensitive) {
function fizzBuzzWoof($n)
{
for ($i=1; $i<=$n; $i++) {
$special = false;
if ($i % 3 === 0) {
echo "Fizz";
$special = true;
}
if ($i % 5 === 0) {
echo "Buzz";
protected function render_custom_menu(custom_menu $menu) {
global $USER;
// If the menu has no children return an empty string
if (!$menu->has_children()) {
return '';
}
if (isloggedin()){
$useremail=$USER->email;
<head>
<script language="javascript" type="text/javascript">
<?php
global $DB;
$category = $DB->get_record('course_categories',array('id'=>$COURSE->category));
$path = explode('/',$category->path);
$root_category_id = $path[1];
$root_category = $DB->get_record('course_categories',array('id'=>$root_category_id));
if (‘Medicine and Dentistry’ === $root_category->name) { ?>
tinyMCE.init({