Skip to content

Instantly share code, notes, and snippets.

<?php
class Controller_ModeA(){
function getPost($key){
return isset($_POST[$key])?$_POST[$key]:null;
}
private $validator;
function accept($validator){
$this->validator = $validator;
$this->validator->visit($this);
<?php
class Controller_ModeA(){
function getPost($key){
return isset($_POST[$key])?$_POST[$key]:null;
}
private $validator;
function accept($validator){
$this->validator = $validator;
$this->validator->visit($this);
}
<?php
class Config{
const TITLE = 'わたしのほうむぺいじ☆';
const URL = 'http://pc11.2ch.net/test/read.cgi/php/1222645553/';
const DESCRIPTION = 'わたしのさいとのすてきな掲示板です☆ミ';
const GENERATOR = '俺様の書いた最強RSSジェネレーター';
/*
* RSSヘッダの画像ファイル名。
*/
const RSS_IMAGE = 'cat1.gif';
<?php
function process($str, $ldelim, $rdelim){
$begin = strpos($str, $ldelim);
$end = strpos($str, $rdelim, $begin + strlen($ldelim));
if(false === $begin){
return strtoupper($str);
}
if(false === $end){
return strtoupper(substr($str, 0, $begin)) . $ldelim
. strtolower(substr($str, $begin + strlen($ldelim)));