Skip to content
Advertisement

How do i filter the output of a scraper? (PHP) [closed]

I am scraping a page and i am getting this result:

JavaScript

But i want a result like this:

JavaScript

So technically i want to filter the prices (without + signs) and the bread names (pist.wit etc.) Does someone know how to do this? Here is my code:

JavaScript

Advertisement

Answer

I assume you meant that you have the price and names as 2 values as noted below.

JavaScript

Result:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement