Re: [PHP] Short circuit evaluation and include

2008-12-03 Thread David Ansermot

include and include_once dont throw fatal exception.

You should use require or require_once and catch the exception with 
try{}catch{} block




[EMAIL PROTECTED] a écrit :

include and require are not functions.

They are language constructs.

They probably don't "return values" nor short-circuit in the usual way.

Ditto for "echo"

If you can strip the parens and have it still work, it's for sure not a 
function.



is perfectly valid code.

PS
All those disk calls are going to get pretty expensive if your site gets heavy 
traffic...
You may want to just write a custom error_handler and use include_once which 
will let you trap the error and do something intelligent with it...



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: removing text from a string

2008-11-04 Thread David Ansermot

Adam Williams a écrit :

I have a file that looks like:

1. Some Text here
2. Another Line of Text
3. Yet another line of text
340. All the way to number 340

And I want to remove the Number, period, and blank space at the begining 
of each line.  How can I accomplish this?


Opening the file to modify it is easy, I'm just lost at how to remove 
the text.:







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php