[php] Proxy file maken

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

Verwijderd

Topicstarter
-

[ Voor 99% gewijzigd door Verwijderd op 09-08-2013 12:07 ]


Acties:
  • 0 Henk 'm!

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 09-09 13:58

NMe

Quia Ego Sic Dico.

Mijn regular expression-kennis is wat roestig, maar ik geloof dat dit wel zou moeten werken:
PHP:
1
2
3
function AHREF2text($string) {
  return preg_replace("#<a [^<>]*href=["\']?([^ "\']*)["|\']?[^<>]*>([^<]*)</a>#i" ,'[\\3] (link: \\2)', $string);
}

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.