Questions tagged as 'preg-replace'

1
answer

Eregi_replace for preg_replace [duplicate]

Regular expression is not my strong in PHP and I need your help. I need to transform a string that comes from a post apt to be part of a url. Example: "Caius did not take a bucket of water" to "fell-did-not-catch-a-bucket" and then he would...
asked by 15.01.2018 / 05:16
1
answer

PHP: Replacement of characters within a string starting from a given position

I need a way in PHP to replace parts of strings from a given position, for example: String: aaa aaaaaaa Replace from 3rd character with "-" Result: aaa ------- or String: aaaaaaa aaa Replace 7th with "-" Result: ------- aaa o...
asked by 26.05.2017 / 16:25
1
answer

Replacement of accented characters

The preg_replace function is not behaving the way I did. When I run the code $string = preg_replace("/[ÁÀÂÃÄáàâãä]/", "a", $string); what I get returned is a string full of "a's." If the string has "ÀÀ á â Í Í ì" "a a a a a a a a a...
asked by 02.06.2016 / 15:14