0

I have been creating and working on different websites. Many a times a get a problem that the code needs to be parsed(One good example is when I wanted to display Ads between the posts. I had to parse the code script to work.) I am really confused about what actually parsing is. I had googled for it but did not found any satisfactory results to clear out the concept. I would be very thankful if anyone could explain me what parsing actually is and why is it necessary in some cases?

I have read What is parsing? but I did not helped me to clear out the concept. Thanks

Community
  • 1
  • 1

1 Answers1

4

In very simple terms parsing is transforming one thing to another with equal meaning. For example:

  • (Dec) 66
  • (Hex) 42
  • (Oct) 102
  • (Html) &#66

Those all state the same letter B.

So if id parse the letter B to html I'd get &#66.

What you are doing with parsing your code is practically the same.

Rick Hoving
  • 3,585
  • 3
  • 29
  • 49
  • Why do we need to parse if its the same? –  Mar 04 '12 at 06:28
  • 1
    Well for example a function only accepts a double as parameter. You only have a integer value. In this case you can parse your integer to a double so it can be passed on as a parameter. Or for example you get a json string and need an array. In this case you can parse the json string to an array. – Rick Hoving Mar 04 '12 at 14:05