Hello, This is the original code. $find[] = '“'; // left side double smart quote $find[] = 'â€Â'; // right side double smart quote $find[] = '‘'; // left side single smart quote $find[] = '’'; // right side single smart quote $find[] = '…'; // elipsis $find[] = 'â€â€'; // em dash $find[] = '–'; // en dash $replace[] = ""; $replace[] = ""; $replace[] = ""; $replace[] = ""; $replace[] = ""; $replace[] = ""; $replace[] = ""; $text = str_replace($find, $replace, $text); PHP: Can i use it like this. Can i use $replace[] = ""; PHP: once instead of the number of $find $find[] = '“'; // left side double smart quote $find[] = 'â€Â'; // right side double smart quote $find[] = '‘'; // left side single smart quote $find[] = '’'; // right side single smart quote $find[] = '…'; // elipsis $find[] = 'â€â€'; // em dash $find[] = '–'; // en dash $replace[] = ""; $text = str_replace($find, $replace, $text); PHP:
Sure wilil work just fine you can feed str_replace an array as the needle and a simple string as the replacement.