Beispiel #1
0
 /**
  * @param $node \Symfony\Component\DomCrawler\Crawler
  * @param string $attr
  * @param $trim
  * @return string
  */
 public function getValue($node, $attr, $trim)
 {
     $temp = '';
     try {
         if (Utils::isBlank($attr)) {
             $temp = $node->text();
         } else {
             $temp = $node->attr($attr);
         }
     } catch (\Exception $e) {
     }
     if ($trim == 'timestamp') {
         $temp = preg_replace('/.*ldst_strftime\\(/', '', $temp);
         $temp = preg_replace('/,.*/', "", $temp);
         $temp = trim($temp);
     }
     if ($trim == 'hash') {
         preg_match('/([0-9a-zA-Z]+)$/', $temp, $m);
         $temp = trim($m[0]);
     }
     return Utils::trimQsa($temp);
 }