1 replies
I'm trying to get all the strings between the strings below in $textall

Code:
preg_match_all('/<span itemprop="name">(.*)<span itemprop="name">/', $textall, $matches);
I'm still getting used to preg_match, but it looks like a huge time saver to avoid looping for my results. I don't think I have the format correct.

Thanks,

Rick
#pregmatchall
Avatar of Unregistered
  • Profile picture of the author Lea Myriam
    Hello Guy, you need a "break" some caracteres. For break, use \
    Example:
    \$ -> string $
    \+ -> string +

    Test this:
    preg_match_all('/<span itemprop=\"name\">(.*)<span itemprop\=\"name\">/', $textall, $matches);

    See to, the subject not is close, for example:
    <?php
    $textall = "<span itemprop='name'>sasajksajskahsaksahsakjasash</span>";
    preg_match_all("/<span itemprop='name'>(.*)<\/span>/", $textall, $matches);
    print_r($matches);
    {{ DiscussionBoard.errors[11356812].message }}

Trending Topics