I am trying to get a title of a page in two ways:
with the html meta < title> lable and with Open Grap og:title.
So I'm using the following regex expressions:
$title_expression = "/<title>([^<]*)<\/title>/";
$title_og_expression = "/og:title[^>]+content=\"([^\"]*)\"[^>]*>/";
preg_match($this->title_expression, $this->content, $match_title);
preg_match($this->title_og_expression, $this->content, $match_title2);
$output = $match_title[1].'+'.$matcht_title2[1];
Is there a way I can do this with only one preg_match?
Note that I don't want One OR the Other, but rather BOTH values.
Thanks for your advice!