- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$matches = array();
$template = '<p>{{{ 发货单号 }}}</p><p>{{{ 单据123号 }}}</p><p>{{{ 拉包 }}}</p><p>{{{ a }}}</p><p>{{{ a }}}</p>';
$ret = preg_match_all('/\{\{\{ \S+ \}\}\}/', $template, $matches);
print_r($matches);