Title: str_replace array
Last modified: March 13, 2021

---

# str_replace array

 *  Resolved [ak2447](https://wordpress.org/support/users/ak2447/)
 * (@ak2447)
 * [5 years ago](https://wordpress.org/support/topic/str_replace-array/)
 * I am using [str_replace(array(“\n”, “\r\n”), array(“<br />”, “<br />”), {column_29[
   1]})] however since PHP 7.3 curly braces in an array are deprecated. So even 
   though the curly braces here aren’t technically part of the array, PHP is seeing
   them and erroring out.
 * Is there a way to write this and escape the curly braces, while keeping the array
   and the column reference variable in tact?
 * Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [ak2447](https://wordpress.org/support/users/ak2447/)
 * (@ak2447)
 * [5 years ago](https://wordpress.org/support/topic/str_replace-array/#post-14178226)
 * Actually upon further debugging it looks like the plugin needs a big update to
   remove all the curly braces from all array types.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years ago](https://wordpress.org/support/topic/str_replace-array/#post-14196886)
 * Hi [@ak2447](https://wordpress.org/support/users/ak2447/),
 * The curly braces aren’t a problem here, but you need to use a custom function
   instead of using str_replace inline, e.g.:
 *     ```
       function my_replace_data( $data ) {
       	return str_replace( array( "\n", "\r\n" ), array( "<br>", "<br>"), $data );
       }
       ```
   
 * You’d use this function in the import template like this:
 * `[my_replace_data({column_29[1]})]`
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years ago](https://wordpress.org/support/topic/str_replace-array/#post-14261222)
 * Hi [@ak2447](https://wordpress.org/support/users/ak2447/),
 * I’m marking this as resolved since we haven’t heard back. Please start a new 
   topic if you have any other questions.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘str_replace array’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/str_replace-array/#post-14261222)
 * Status: resolved