On 1 March 2011 03:07, Alexis <[email protected]> wrote:
> Hi,
>
> I know not strictly a PHP question, but was just wondering if someone can
> tell me the regex format for something please.
>
> I need to replace
> ......
> with
> --------
> That is six periods replaced by eight hyphens.
>
> Many thanks
> Alexis
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
$text = preg_replace('/\.{6}/', '--------', $text)
but
$text = str_replace('......', '--------', $text);
is going to quicker.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php