Search found 25 matches
- Sat Jul 28, 2012 11:50 pm
- Forum: PHP - Code
- Topic: regex question
- Replies: 3
- Views: 915
Re: regex question
yes, it should be de. sorry for the mistake. editted the post
- Sat Jul 28, 2012 11:37 pm
- Forum: PHP - Code
- Topic: tick question
- Replies: 0
- Views: 939
tick question
I was playing with the sample code: declare(ticks=1); // A function called on each tick event function tick_handler() { echo "tick \n"; } register_tick_function('tick_handler'); $a = 1; if ($a > 0) { $a += 2; print($a); } in the explanation, I expect the output to be tick tick 3 tick tick,...
- Fri Jul 27, 2012 11:09 pm
- Forum: PHP - Code
- Topic: regex question
- Replies: 3
- Views: 915
regex question
I notice all regex in PHP begins with / character. Does this signal the beginning of line? preg_match('/abc 12(de)??/','xxxyyy abc 12de, gghh',$result); var_export($result); will yield array (0=>'abc 12',) while preg_match('/abc 12(de)?/','xxxyyy abc 12de, gghh',$result); var_export($result); will y...
- Fri Jul 27, 2012 11:01 pm
- Forum: PHP - Code
- Topic: confused with statement
- Replies: 2
- Views: 620
Re: confused with statement
Thank you very much. Now it's more understandable how operator precedence works.
- Fri Jul 27, 2012 10:22 am
- Forum: PHP - Code
- Topic: confused with statement
- Replies: 2
- Views: 620
confused with statement
Code: Select all
echo $a = $b == $b;
- Fri Jul 27, 2012 6:18 am
- Forum: PHP - Code
- Topic: \n problem
- Replies: 4
- Views: 1058
\n problem
AFAIK, \n is global convention for newline. but
produces a\nb
and
produces ab
Can anybody explain this behavior? and how can one print newline character? I've always used <br>. thanks
Code: Select all
echo 'a\nb';
and
Code: Select all
echo "a\nb";
Can anybody explain this behavior? and how can one print newline character? I've always used <br>. thanks
- Fri Jul 27, 2012 3:33 am
- Forum: PHP - Code
- Topic: what's the difference?
- Replies: 5
- Views: 1111
Re: what's the difference?
thanks for the reply requinix, does this mean I use :: only when referring to any static functions or members only? what's the side effect if I use :: to call instance member and functions?
- Fri Jul 27, 2012 3:31 am
- Forum: PHP - Code
- Topic: what is ^ symbol
- Replies: 4
- Views: 1329
Re: what is ^ symbol
yes, XOR seems right. thanks
- Fri Jul 27, 2012 1:28 am
- Forum: PHP - Code
- Topic: what's the difference?
- Replies: 5
- Views: 1111
what's the difference?
What's the different effect when accessing member using
and
Code: Select all
$this::doIt();
Code: Select all
$this->doIt();
- Thu Jul 26, 2012 11:10 pm
- Forum: PHP - Code
- Topic: what is ^ symbol
- Replies: 4
- Views: 1329
what is ^ symbol
I encountered this code:
what operation is this? I've searched in php manual, but couldn't find it. thanks
Code: Select all
$x^=$y
- Mon Jul 23, 2012 9:13 pm
- Forum: Testing
- Topic: debugging in PHP
- Replies: 1
- Views: 27542
debugging in PHP
How can I debug in PHP? I'm using Eclipse PDT, and I wish to see the execution steps line per line like F6 in Java Debug As. Thank you.
- Sat Jul 21, 2012 3:15 am
- Forum: PHP - Code
- Topic: what's the point of function &do_job()?
- Replies: 3
- Views: 834
Re: what's the point of function &do_job()?
which are valid? function test(){ return &object; } function &test(){ return &object; } function &test(){ return object; } I also assume that if the function returns a reference (we're talking about scalar types only now), the variable to which the returned reference is assigned must...
- Thu Jul 19, 2012 10:29 am
- Forum: PHP - Code
- Topic: what's the point of function &do_job()?
- Replies: 3
- Views: 834
what's the point of function &do_job()?
what's the point of the superfluous ampersand in &do_job? as far as I know, PHP starting from 5 always return reference instead of value? what's the purpose of this (assuming I'm creating brand new app with 5.4 with no need for backward compat).
- Wed Jul 11, 2012 12:37 am
- Forum: PHP - Security
- Topic: Whats Your Security Regimen ?
- Replies: 14
- Views: 22311
Re: Whats Your Security Regimen ?
what about DB code 2? is it free of SQL injection? even without calling sanitizeInput at all?
also, I put critical files outside web root, is there any way at all to access those critical files via browser? or is it safe already?
also, I put critical files outside web root, is there any way at all to access those critical files via browser? or is it safe already?
- Wed Jul 11, 2012 12:10 am
- Forum: PHP - Security
- Topic: access protected file without include
- Replies: 10
- Views: 15660
Re: access protected file without include
Could you please explain more about this 'secure coding'? are you referring to sanitizing?