Re: REGEX help please
- From: Zilla <mail.is.not@xxxxxxxxx>
- Date: Thu, 29 Sep 2005 15:09:55 +0200
Defaultman wrote:
1) change a string of: number\number\number to number/number/number
You don't have to use regexp to do this. Try this:
$var = str_replace('\\', '/', $var);assuming $var contains the string you want to change.
2) change a string of: numbers to digit/digit/digit
This you can du with chunk_split():
$var = chunk_split($var, 1, '/');
This puts a '/' between every character in $var AND in the end. So if you don't want the '/' in the end you can remove it with substr():
$var = substr($var, 0, -1);
Hope this is useful.
Zilla. .
- Follow-Ups:
- Re: REGEX help please
- From: Defaultman
- Re: REGEX help please
- References:
- REGEX help please
- From: Defaultman
- REGEX help please
- Prev by Date: Re: Errors in php 5.0.4 Not in 4.3.10-16
- Next by Date: Re: Table Drawing with jpgraph
- Previous by thread: REGEX help please
- Next by thread: Re: REGEX help please
- Index(es):
Relevant Pages
|