easy regex problem
Posted: Mon Nov 28, 2011 3:15 pm
Hi,
I'm new to regex. I have an array with the elements like so:
Here is my $keys array :
array
'IP:Port' => string '216.114.46.6:3128' (length=17)
'Response Time' => string '0' (length=1)
'Server Speed' => string '0' (length=1)
I would like to replace the ':' with somthing else (like '_' )
here is my regex:
preg_replace('/":"/', "_", $keys);
Its not working. Can anyone show me what I'm doing wrong?
Thanks in advance,
KC
I'm new to regex. I have an array with the elements like so:
Here is my $keys array :
array
'IP:Port' => string '216.114.46.6:3128' (length=17)
'Response Time' => string '0' (length=1)
'Server Speed' => string '0' (length=1)
I would like to replace the ':' with somthing else (like '_' )
here is my regex:
preg_replace('/":"/', "_", $keys);
Its not working. Can anyone show me what I'm doing wrong?
Thanks in advance,
KC