Значи имам файл class.php:
и Index.php:
Защо не работи кода?
Код:
<?
class Search
{
function tarsi($text)
{
$this->new = preg_match_all("/(\b(https?):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/i",$this->text,$this->matches);
return $this->matches[0];
}
}
?>
и Index.php:
Код:
<?php
include("classes.php");
$search = new Search;
$file = "http://sadsadsad asdsa sadsad sdsfdsa sf<a href='w'><sadas";
$r = $search->tarsi($file);
foreach ( $r as $a ) { echo $a; }
?>
Защо не работи кода?