[PHP] Re: newbie OOP?
I think it's always worth it to at least design using OO methodologies. The coding moves much faster and is much easier to maintain, in my experience. A couple of books I've read recently that I'd recommend: The Object-Oriented Thought Process by Matt Weisfeld and Bill McCarty Design Patterns Explained: A New Perspective on Object-Oriented Design by Alan Shalloway and James R. Trott If you approach the small sites as ways to add objects to your toolbox, you'll end up with reusable objects that are continually refined as you use them in new ways. (imho) - john Bobby Rahman wrote: > > > > Hiya > > I am new to PHP and was wondering whether to develop small applications > (20 pages ) is it worth it to use OOP? Can any recommend any books or > URLS that explain Object orientated programming and design in detail. > I have read articles in > > www.phpbuilder.com and > www.phppatterns.com. > > In particular I am having troubles breaking my application design-wise, > into classes and operations. > > Any suggestions and tips > > Cheers > > _ > Stay in touch with MSN Messenger http://messenger.msn.co.uk > Bobby Rahman wrote: Hiya I am new to PHP and was wondering whether to develop small applications (20 pages ) is it worth it to use OOP? Can any recommend any books or URLS that explain Object orientated programming and design in detail. I have read articles in www.phpbuilder.com and www.phppatterns.com. In particular I am having troubles breaking my application design-wise, into classes and operations. Any suggestions and tips Cheers _ Stay in touch with MSN Messenger http://messenger.msn.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: str_replace
$footer = str_replace('include("$header");', '', $footer); The way you have it now, you're telling PHP to first include the file named by the variable $header, then do an str_replace on the result; but the parser is going to fail on that first semi-colon, and that's not what you want to do anyway (as I understand it). Put the line you want to replace inside single quotes (as above) and PHP won't attempt to parse it, it'll just treat it as a string literal. Hope this helps, hope it makes sense. - john Sebastian wrote: This may seem weird: How do I str_replace an include function? I want to replace this line: include("$header"); with nothing .. something like this: $footer = str_replace(" '. include("$header"); .' ", "", $footer); I get errors, any ideas? cheers, - Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php