Solved

Do I need a PHP project for this?

Posted on 2013-06-28
4
284 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
ID: 39283668
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
ID: 39285007
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
ID: 39285386
0
 

Author Closing Comment

by:sukhoi35
ID: 39286345
Thanks!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

914 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

18 Experts available now in Live!

Get 1:1 Help Now