How do I replace any number of character occurences with one occurrence?


Posted on 16th Feb 2014 07:03 pm by admin

How do I replace any number of character occurences with one occurrence?

Let's say I have:

Did you know?Explore Trending and Topic pages for more stories like this.
aaa
aaaaaa
aaaaa
aaaaaaaa

All of the above should be replaces with a single 'z' character say for example

I can do exact matches, say for 'aaaaaa' - but am unsure how I can do for any number

I'm sure it should be possible to do using one line of code - but I'm just not sure where to start!

Thanks
No comments posted yet

Your Answer:

Login to answer
255 Like 38 Dislike
Previous forums Next forums
Other forums

I didnt code this but I need help with it
I'm sorry. i'm not a coder. I have this script for forcing download and previewing mp3. The guy that

Login logout link help
Hi all,

Im new to php and Im having trouble creating a login/logout link for my page that dis

Redistributing dependent dlls
Hai all ,

I have created an application in VC++ using VS2008 in a development machine which r

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

connect() succeeds but accept() does not?
Please help me with this problem. I'm working on a time-sensitive project where I'm using TCP socket

Sessions Value Not Saved
Hi,

Im making a login form and im using this code:
Code: if($login=="true"){

Multidimensional Array into an Html table, help!
Hello all, I am new to HTML/PHP so any help would be great.

I have a multidimensional array f

delete comma
HI,

How to delete "," at the end of the string.
Code: $match = 2009/02/03/a2corr

Day of week
I am using PHP version 5.0.5
I have a varaible ($DATE (date format yyyy-mm-dd)) that is being inc

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash