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:

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

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages

UPLOAD IMAGES NOT WORKING!
Hi there i have a upload script in which it uploads the picture to a folder than creates two thumbna

PHP MySQL and DATE
Hi everyone

I have a databse and in one of the columns I have date values such as 2009-March-

Simple image grab script.
I was wondering if it was possible and if anyone knew how to make a simple php script that looks at

Inserting multiple records from single form
I've found a number of threads that deal with this issue, but I'm new to php and coding language so

Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

Select Lists into MYSQL
Hello All, I am new to PHP @ 1 week. So borrowing code anywhere I can. I am making progress, but h

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