Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11148 > unrolled thread

Re: help to debug a simple php preg_replace

Started byLuuk <Luuk@invalid.lan>
First post2011-01-28 19:01 +0100
Last post2011-01-28 19:01 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.php

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: help to debug a simple php preg_replace Luuk <Luuk@invalid.lan> - 2011-01-28 19:01 +0100

#11148 — Re: help to debug a simple php preg_replace

FromLuuk <Luuk@invalid.lan>
Date2011-01-28 19:01 +0100
SubjectRe: help to debug a simple php preg_replace
Message-ID<jscb18-fbm.ln1@luuk.invalid.lan>
On 28-01-11 18:43, juliani.moon@gmail.com wrote:
> Ooops, the copy-paste was a mess.  Now it is again:
> 
>  <?php
>  if (file_exists("infile")) {
>   $textline = file_get_contents("infile");
>   $hyprtext = preg_replace('/</', '&#60;', $textline);
>   $hyprtext = preg_replace('/>/', '&#62;', $textline);
>   $hyprtext = preg_replace('/@/', '_at_', $textline);
>   $hyprtext = preg_replace("/(http:\/\/[^\s]+)/", "<a href=\"$1\">$1</
> a>", $textline);
>   print "$hyprtext";}
>  ?>
> 
> Note: The line for "http" works fine.

read the docs again... ;)

http://php.net/manual/en/function.preg-replace.php

-- 
Luuk

[toc] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web