Hi!
Does somebody know how big strings i can use in str_replace?
mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
how big can be the $search string and how big can be the $replace string?
E: and $subject also
Printable View
Hi!
Does somebody know how big strings i can use in str_replace?
mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
how big can be the $search string and how big can be the $replace string?
E: and $subject also
The string can be any size, it could be a large paragraph. But if you have a large number of pages to search through it may take some time to find and replace what you want.
tnx for quick replay.
I have problem in system what i'm developing. it is old and big and :)
the system stops in a certain place always.
and on that place there is the row:
$XML = str_replace($file, $this->$func($file), $XML);
where the sizes are following: 78084 / 0 / 84808 as strlen() is giving.
Can it be, that the sizes are too big for checking and memory will get over?
Or any other suggestion why it stops in that certain row?
Strange, have you done a strlen() on the file in question? If so whats the number?
strlen for file gives: 78084
strlen for $XML gives: 84808
unfortunatly its not my code but i have to fix it :D
Long time ago i was thinking the problem was about memory using. but now when system has 128MB to use and it is using around 14MB before that line, then i do not think so.
Does it give an error code? Also, can we see a snipet of code used?
Your host (or your own configuration) may be limiting the amount of memory PHP can use no matter how much your server has. You can check phpinfo() or view your php.ini file.
ok. Found that the problem is not in str_replace but preg_replace.
tnx, for helping. topic closed.
Have to fint now solution, why preg_replace is not working :)