WordPress.org

Make WordPress Core

Ticket #11097: test_preg_replace.php

File test_preg_replace.php, 255 bytes (added by bonaireguy, 4 years ago)

Test code to demonstrate the documented bug

Line 
1<?php
2
3$text = ' id="attachment_7" align="aligncenter" width="156" caption="Fresh Mint Tea in The Netherlands';
4
5print("Input text: |$text|<p>");
6
7$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
8
9print("Output text: |$text|<p>");
10
11?>