Solved

Do I need a PHP project for this?

Posted on 2013-06-28
4
287 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 109

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery Dialog Autoresize Bug 2 24
SSRS 2016 Rendering HTML tables 3 26
jQuery Toggle & Anchor Links 5 43
Search Item in Table 2 19
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will learn how to count occurrences of each item in an array.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

808 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