Questions tagged [ereg-replace]

ereg_replace() is a PHP function that performs string replacement using regular expressions.

ereg_replace() is a PHP function that performs string replacement using regular expressions.

This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged. See https://php.net/manual/en/function.ereg-replace.php.

50 questions
0
votes
3 answers

Ereg_replace with a String

I have a string like this: $str = "{gfgd}i:123;a:7:{gfgd}i:5;a:35:"; And I want to replace it to: $str = "{gfgd},{gfgd},"; I want to use ereg_replace with it and replace this kind of phrase: "i:[0-9]a:[0-9]:" into "," sign. I try it: …
Ir3nicus
  • 5
  • 2
0
votes
1 answer

need an help for ereg_replace (deprecated)

Hello i've writen a few scripts 2 or 3 years ago. Now it's not running. My scripts :
0
votes
1 answer

php - deprecated function ereg_replace() is deprecated in php

I Just Bought a PHP Script That Was Working Properly Till I Test It ON my Web Server. When I ran THe Script It looks Great But When I click the Sub-Category of my Website I gives me This Error "Deprecated: Function ereg_replace() is deprecated in…
Redwan
  • 11
  • 1
  • 5
0
votes
1 answer

Ereg_replace to preg_replace Lep

How would I make these two previous ereg_replace expressions work with preg_match? http://([.]?[a-zA-Z0-9_/-])*| and (^| |\n)(www([.]?[a-zA-Z0-9_/-])*) adding code from comment preg_replace("http://([.]?[a-zA-Z0-9_/-])*", "
0
votes
1 answer

Conversion of ereg_replace to preg_replace, PHP 5,3

For changing to PHP 5,3 ... not sure if I can just change the function name in the below from ereg_replace to preg_replace - if that will result in the same or if the syntax has to be changed as well regarding "[\n\r]" og "\t\t+" - anyone who can…
Brian Langhoff
  • 151
  • 2
  • 3
  • 13
0
votes
3 answers

ereg_replace not working correctly

I've created a message system and would like to auto-convert url-links in a message to clickable HTML links if a new message is posted. I wrote this simple function but it isn't working as it should: // LINK ALL URLS $message =…
user1742161
0
votes
1 answer

quick ereg_replace to preg_replace

I am learning PHP functions and have this problem: I need to change the function *ereg_replace* $row[$j] = ereg_replace("\n", "\\n", $row[$j]); to *preg_replace* how to do it ? Thank you
Ing. Michal Hudak
  • 5,338
  • 11
  • 60
  • 91
0
votes
1 answer

Converting this ereg_replace to preg_replace

I need to change the ereg replace to a preg replace on this statement: $return = trim(ereg_replace(' +',' ',preg_replace('/[^a-zA-Z0-9\s]/','',strtolower($input)))); However it errors when I make the change. Any ideas on the fix to make this work?
0
votes
2 answers

ereg_replace code

i updated my php to 5.3 and i have a problem with my ereg_replace $txt = ereg_replace("<(/)?(font|span|div|del|ins)[^>]*>","",$txt); $txt = ereg_replace("<([^>]*)(class|lang|style|size|face)=(\"[^\"]*\"|'[^']*'|[^>]+)([^>]*)>","<\\1>",$txt); $txt =…
0
votes
1 answer

the wonders of converting ereg_replace to preg_replace

I need to convert 4 ereg_replace expressions to preg_replace. I've been trying various combinations based on tutorials and not getting too far with getting my site to work. Can some kind soul assist me in resolving these? $path =…
lokust
  • 51
  • 1
  • 6
0
votes
3 answers

error when changing ereg_replace to preg_replace

I am working on old sites and updating the deprecated php functions. I have the following code, which creates an error when I change the ereg to preg. private function stripScriptTags($string) { $pattern = array("'\/\*.*\*\/'si",…
Jamie
  • 1,579
  • 8
  • 34
  • 74
0
votes
1 answer

could someone help me with my ereg_replace converted to preg_replace

I just need a bit of help with my ereg_replace changed to preg_replace.. ereg_replace('', '', $match); and I've tried preg_replace('//', '', $match); but it doesn't work.. and it says "Warning:…
SoulieBaby
  • 5,405
  • 25
  • 95
  • 145
0
votes
2 answers

How to extract only integers from string and chosen letters?

I am successfully extracting integers from string. How to do it but including strings: "k ", "m " and "b "? This code takes given website code and extracts numbers, I need numbers and "k ", "m " and "b " $objectId = 15259; $lines =…
Szymon Toda
  • 4,454
  • 11
  • 43
  • 62
-1
votes
4 answers

PHP preg_replace -####/

I'm back again to show my ignorance once more. I need assistance grabbing numbers that are in a URL in a specific spot. The rest of the URL may also contain numbers so I need to restrict it to grabbing the numbers from just one location, for…
Scott Rowley
  • 486
  • 1
  • 7
  • 30
-1
votes
2 answers

eregi_replace() to preg_replace() help

Possible Duplicate: Converting ereg expressions to preg I've tried this a number of different ways and I've even downloaded the Regular Expression reference sheet from addedbytes.com, but I just can't figure out how to move this eregi_replace()…
Hummdis
  • 57
  • 5