Random Number
$randomnumber= rand(1,10);
Replace 1 and 10 with the range you want to pick a number between.
TextSnippets > php >
Post code snippets. Sort by tags, people, people and tags, etc..
? Earlier | 10 items total | Later ? |
$randomnumber= rand(1,10);
$set_table="0"; ?>
{exp:allow_eecode}{body}{/exp:allow_eecode}
Bla bla regular entry text
{exp:allowphp} echo "This will be processed as PHP."; {/exp:allowphp}
$fs_refer= $_SERVER ['REQUEST_URI']; $fs_refer = explode("?", $fs_refer); echo "$fs_refer[0] is now a URL without ?.
"; echo "$fs_refer[1] is the bit that used to follow the ?."; ?>
$varshort = substr($var,0,25); echo "$varshort"; ?>
// trim spaces from the beginning and the end of the variable $field_name = trim($field_name); // strip all HTML from the variables $field_name = strip_tags($field_name); // change the case of the variable to capitalize (It Will Look Like This - handy for Name fields) $field_name = ucwords(strtolower($field_name)); // change the case of the first character to uppercase, the rest to lowercase (It will look like this) $field_name = ucfirst(strtolower($field_name)); //change the case of the variable to lowercase $field_name = strtolower($field_name); // change the case of the variable to uppercase $field_name = strtoupper($field_name); ?>
$text = preg_replace('/\s+/', ' ', $text); ?>
$variable = trim($variable);
? Earlier | 10 items total | Later ? |