class MyClass
{
function __construct()
{
if ($this)
{
exit;
}
}
}This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
September 13, 2010 10:01am
Subscribe [15]#16 / Oct 06, 2010 2:44pm
class MyClass
{
function __construct()
{
if ($this)
{
exit;
}
}
}#17 / Oct 09, 2010 11:57am
function hoppity($string,$repeat){
foreach (range(1, $repeat) as $i) {
if ($i % 3 == 0 && $i % 5 == 0) {
echo $string.'
';
} elseif ($i % 3 == 0) {
echo $string.'ity
';
} elseif ($i % 5 == 0) {
echo $string.$string.'
';
}
}
}Usage: hoppity(‘hop’,12);
Maybe the real geeks will realise that this function wasn’t entirely useless… =)
#18 / Oct 09, 2010 8:57pm
function select($thing='') { $return = empty($thing) ? 'SELECT '.$thing : 'SELECT *'; return $return; } function from($where) { return 'FROM `'.$where.'`'; } function where($condition) { return 'WHERE '.$condition; } $query = select('crap').from('crappytable').where('crap="crap"'); mysql_query($query);
Hey wait a minute…that’s Active Record!
#19 / Oct 10, 2010 5:19am
Why invent something? Look at the built-in is_null function 😊
#20 / Oct 28, 2010 7:21am
@vheissu Magento is built on top of zend, but incorporates a load of crap on the top of it to boot 😛
Thats the reason i hate magento and still have to work on it coz its selected software for all e-commerce websites at my workplace.
#21 / Oct 29, 2010 4:53am
class Vomit extends Exception { }
$up = new Vomit('oh noes!');
if ($sick):
throw $up;
endif;Haha I made myself laugh because of what I wrote… sigh
#22 / Oct 30, 2010 3:44pm
<?php
$string = "bomb!";
$jerry_hagards_hypothesis = explode( "'" , $string );
?>#23 / Nov 08, 2010 5:59pm
function loremipsumdolorsitamet($string){return implode(' ',array_map('strrev',explode(' ',$string)));}echo loremipsumdolorsitamet('?noitcnufsihttsetuoyyhw');#24 / Nov 17, 2010 7:22am
<?php
echo "Hello World";
?>#25 / Nov 19, 2010 5:35am
<?php
if(php_uname('s') == 'Windows NT') {
die;
} else {
return TRUE; //to da game
}
?>