Tip: Click lines to highlight, hold ctrl/cmd to multi-select
http://codedumper.com/oveju (29-Apr @ 04:07)
Syntax Highlighted Code
- <?php
- function myTestFunction($hasDefaultParamters = true)
- {
- echo "Start\n";
- if($num)
- {
- }
- echo "End\n";
- }
- myTestFunction("hello","world");
- myTestFunction();
- /*
- output:
- Start
- num args: 2
- Array
- (
- [0] => hello
- [1] => world
- )
- End
- Start
- num args: 0
- End
- */
- function authenticate($u = null,$p = null,$redirect = 0){
- if($numArgs >= 2) {
- if($authID = User::__validCredentials($u,$p) {
- return $authID;
- }
- else if ($redirect) {
- redirect('/login');
- }
- }
- }
- return 0;
- }
Plain Code
<?php
function myTestFunction($hasDefaultParamters = true)
{
echo "Start\n";
echo "num args: " . ($num = func_num_args()). "\n";
if($num)
{
print_r(func_get_args());
}
echo "End\n";
}
myTestFunction("hello","world");
myTestFunction();
/*
output:
Start
num args: 2
Array
(
[0] => hello
[1] => world
)
End
Start
num args: 0
End
*/
function authenticate($u = null,$p = null,$redirect = 0){
if ($numArgs = func_num_args() > 0){
if($numArgs >= 2) {
if($authID = User::__validCredentials($u,$p) {
$this->session->set_userdata(array('user_id'=>$authID));
return $authID;
}
else if ($redirect) {
redirect('/login');
die("Redirecting...");
}
}
}
return 0;
}