Is it possible to get a certain class name through cURL?
For instance, I just want to get the 123 in this <div class="123 photo"></div>.
Is that possible?
Thanks for your responses!
Edit:
If this is whats seen on a website
<div class="444 photo">...</div>
<div class="123 photo">...</div>
<div class="141 photo">...</div>
etc...
I’m trying to get all the numbers of this class, and putting in an some array.
cURLis only half the solution. Its job is simply to retrieve the content. Once you have that content, then you can do string or structure manipulation. There are some text functions you could use, but it seems like you’re looking for something specific among this content, so you may need something more robust.Therefore, for this HTML content, I’d suggest researching
DOMDocument, as it will structure your content into an XML-like hierarchy, but is more forgiving of the looser nature of HTML markup.