Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 05-05-2012, 02:38 PM
Junior Member
 
Join Date: 03-11-12
Posts: 18
iTrader: 0 / 0%
How to convert it into object oriented?

This is a small php which will read the youtube RSS feed. What I want to do is convert it into object oriented. Using class and function. I am new to object oriented, can some body show me a way how and where to start with? I have read the acticle from php dot net but still I am a bit confuse.

a small example will be appreciate
thank you for your help

Code:
<?php $html = ""; $url = "http://gdata.youtube.com/feeds/api/users/Sindrannaras/uploads"; $xml = simplexml_load_file($url); for($i = 0; $i < 10; $i++){ $author = $xml->entry[$i]->author->name; $id = $xml->entry[$i]->id; $id = str_replace("http://gdata.youtube.com/feeds/api/videos/","",$id); $title = $xml->entry[$i]->title; $content = $xml->entry[$i]->content; $html .= "<div><h3>$title</h3>"; $html .= " $id<br /> $content<br />"; $html .= "<hr /></div>"; } echo $html; ?>
 
Reply With Quote
  #2 (permalink)  
Old 05-07-2012, 02:32 AM
JohnnyS's Avatar
Contributing Member
 
Join Date: 07-05-11
Location: philippines
Posts: 312
iTrader: 0 / 0%
you can try this php class
 
Reply With Quote
  #3 (permalink)  
Old 05-14-2012, 05:07 AM
Junior Member
 
Join Date: 05-11-12
Posts: 24
iTrader: 0 / 0%
First try to understand the ideas of OO programming and you will figure it out yourself.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Goal oriented Keywords?? dbs213 SEO Forum 8 11-04-2011 02:05 AM
Any theme Any PR - US oriented jamie-patrick Want To Exchange Links 3 08-24-2010 07:21 PM
WTS: 2 Articles "How a Browser Connects" Object-Oriented Programming Block by Block shafiqamiami Content 0 12-19-2009 04:51 AM
Warning: Object Oriented Programming via PHP on IIS FGTH Web Design Lobby 1 08-30-2009 07:40 AM
<object> </object> area clickable softstor Coding Forum 3 06-14-2004 11:35 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 04:19 AM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.