
Originally Posted by
boypahak
noy.juan: pwede diay together OOP and the usual PHP? can you give me some examples how you use both? I dont know lang pud kai para sa akoa, from learning the basics of OO PHP murag lahi ra jud sya. ambot lang sad kai as of now dili pa in ana ka wide akong knowledge sa OO PHP busa dili pa nako sya ma appreciate.
cebugdev: ah ok, so your pro OO. organize, clean and handy - maybe later if ever I use OO masabtan nako imo pasabot. like I said Im new to OO PHP, but yeah I know how powerful OO is coz ive gone through this sa akong java.
for core script i used php class, and for utility script i use traditional
afaik, kusog ang oop interms of execution kay mas organized siya compared to tradidional...
OOP is like a toolbox, dali ra kaayo pangitaon ang mga tools kay naka organize man
traditional, is well classic or how the php should be
like
OOP
PHP Code:
class db{
var $con;
function db(){
}
}
$db = new db();
Tradidtional
PHP Code:
function get_user(){
global $db;
// code
}
get_user();
i used OOP on codes that are used most of the times while traditional for those rarely used