FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » adding a method to a built-in class ?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: adding a method to a built-in class ? [message #179474 is a reply to message #179467] Wed, 31 October 2012 10:09 Go to previous messageGo to previous message
Gregor Kofler is currently offline  Gregor Kofler
Messages: 69
Registered: September 2010
Karma:
Member
Am 2012-10-30 13:05, Une BĂ©vue meinte:
> newbie to php5, i'd like to know if i could add a method to a built-in
> class.
>
> The purpose is to ass #to_sql() method to the String class.
>
> #to_sql() would just replace any oiccurence of the character "'" by two
> of it "''".

There is no such thing as a "string class" in PHP (apart from an
experimental SplString class). However, you can extend the already
mentioned Mysqli and Pdo classes and create subclasses tailored to your
needs.

Gregor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How do I turn on graphics (GD2) on a Windows 7 system?
Next Topic: Output status during processing
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Dec 20 14:35:16 GMT 2024

Total time taken to generate the page: 0.05755 seconds