Solved

Do I need a PHP project for this?

Posted on 2013-06-28
4
283 Views
Last Modified: 2013-06-29
Well, this might be a pretty naive question.
I am new to PHP and am trying to run and walk-through the scraper code at the location http://pastebin.com/MTj4YtjU

I have the latest NetBeans and WAMP installation on my windows machine. For me to do a step-by-step debug of this code, please let me know if it is okay to follow the following steps:

1) Create new PHP application project
2) Create a PHP file within the source folder and paste the source code.
3) Add breakpoint and Run debug.

Please let me know if my understandings are right.
0
Comment
Question by:sukhoi35
  • 2
4 Comments
 

Author Comment

by:sukhoi35
Comment Utility
I read I also need a xdebug application to successfully debug php code. Am currently downloading it.
0
 
LVL 12

Accepted Solution

by:
adrian_brooks earned 400 total points
Comment Utility
Being new to any language is challenging enough in and of itself. When it comes to debugging, there are some less obtrusive methods in use by more seasoned programmers of languages like PHP & Perl, whereby the programmer will just drop in some dumping of variables to determine what's taking place at a given point in the execution of a script or program.

That having been said, I personally choose to  not use formal debuggers for languages like PHP & Perl as the setup is usually far more time intensive than just injecting a single line of code I can use to quickly ascertain what's up at that point in my execution.

If you really desire going the route of a formal debugger, then yes, you will need to install xdebug and perform the integration/setup of it into your IDE before you can get it to work at any level of productive use.

In PHP, I like to use the following snippet for my debugging;

# I use this when I want the output to appear in a browser
print "<pre>"; print_r($var); print "</pre>";
# I use this when I want the output to appear in a console
print_r($var);

Open in new window


Hope this helps.

~AB
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 100 total points
Comment Utility
0
 

Author Closing Comment

by:sukhoi35
Comment Utility
Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Read about why website design really matters in today's demanding market.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now