FAQ |
Kalender |
|
![]() |
#1 | |||
|
||||
Mycket flitig postare
|
preg_match_all('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $text, $matches);
|
|||
![]() |
![]() |
![]() |
#2 | ||
|
|||
Nykomling
|
Jag suger på regexp så gjorde en loop etc..
Kod:
function get_href($string) { $result = array(); $x = 0; $array_1 = explode("href=\"",$string); foreach ($array_1 as $k => $v) { if(strstr($v,"http://") == true) { $v = substr($v,0,stripos($v,"\"")); $result[$x++] = $v; } } return $result; } |
||
![]() |
![]() |
Svara |
|
|