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

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -