php - Large text replace array -


i'm looking when replacing text when i'm importing xml file. want text-replace values when importing, matches categories, filter values etc. on website.

i'm using function. wrote myself copy-pasting internet (i'm not coder) need help/advice.

<?php // text replace test function function my_text_replace($x) {     ($y = 0; $y < 2; $y = $y+1) {         $phrase = $x;         $old = array("draaideurkast", "fout1 mrc", "draaideurkast mrc", "draaideurkast mrc");         $new = array("fout1", "fout2", "goed", "fout3");         $x = str_ireplace($old, $new, $phrase);         $y = $y+1;     return $x;     } } ?> 

code fix: happens not want partial match replace, complete value of $x. in example output should 'goed'. should replace once when found. (but fixed loop think). output should case insensitive.

advice question: correct way of replace (large amounts) of texts during import? guys know other best practises or plugins (wordpress) or tools..

thanks response!

harm


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -