Skip to content
Advertisement

Getting a product price from an ecommerce site using file get content

I am trying to get a product price using php and file_get_contents function. Here is my code. It is loading the whole page however I just need the price from this page. Can someone please help? Thanks

JavaScript

Advertisement

Answer

PHP Simple HTML DOM parser is a godsend for this kind of thing

Get the code here

Just include it on your php

JavaScript

More about this awesome tool

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