- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$text = "_t('landing', 'asdfasdf adfasd')";
$text .= " asdfasd _t('landing', 'asdfasdf adf111asd')";
$text .= " asdfasdfasdf qwerq d fasdf _t('landing page', 'as111dfasdf adfasd')";
$text .= "<a></a> asdfasdf _t('landing', 'asdfasdf 111adfasd')";
preg_match_all("/_t\( *['\"]([a-zA-Z -_]+)['\"] *\, *['\"]([a-zA-Z -_]+)['\"] *\)/i", $text, $matches);
var_dump($matches);