Php? Remove spaces
[Content_ SC] => name of the trade name (Chinese): name of the Company Limited (English): Address of the trade name: Guangzhou operating Project: gold coins, coins, banknotes, stamps, interesting products, tea contact name (Chinese): Zhang San contact name (English): phone 123232328899 Fax: QQ23232370566 Web site: Email: 532326603@99.com $ row ['content _ tc '] = str_replace ('', '', $ row ['content _ tc ']); I use str_replace to replace spaces. However, there is nothing to do with the desired effect [content_ SC] => name of the firm (Chinese ): company name (English): Address: Guangzhou operating Project: gold coins, coins, banknotes, stamps, interesting products, tea contact name (Chinese): name of Michael Zhang contact (English ): phone: 123232328899 Fax: QQ23232370566 Web site: Email: 532326603@99.com
Reply to discussion (solution)
$ S = <TXT name (Chinese): name of the Company Limited (English): Address of the business name: Guangzhou operating Project: gold coins, coins, banknotes, stamps, interesting products, tea contact name (Chinese): Zhang San contact name (English): phone 123232328899 Fax: QQ23232370566 Web site: Email: 532326603@99.comTXT; echo preg_replace ("/[\ t] + /", '', $ s );
Name of the trade name (Chinese): name of the Company Limited (English): Address of the trade name: Guangzhou operating Project: gold coins, coins, banknotes, stamps, interesting products, name of the contact person for tea products (Chinese ): name of contact person (English): phone 123232328899 Fax: QQ23232370566 Web site: Email: 532326603@99.com
Yes
Str_replace ('','', $ row ['content _ tc ']);
Note that the first space is a special symbol.
Do not wrap
Of course, line breaks are not supported in html mode!
Do not wrap
Of course, line breaks are not supported in html mode!
You can view the source code in the browser.
Do not wrap
Preg_replace ("/[\ t] +/", '', $ row ['content _ tc ']); add this sentence to show the same effect as the original one.
I want to remove spaces and keep the line feed when displaying them.
$ Row ['content _ tc '] = preg_replace ("/[\ t] +/", '', $ row ['content _ tc']);
Are you stupid to make any mistakes?
$ Row ['content _ tc '] = preg_replace ("/[\ t] +/", '', $ row ['content _ tc']);
No line breaks
Only text line breaks are in your data, while html line breaks are
Are you sure you want to forget this?
Baidu replaced the text line break
$row['content_tc']=preg_replace("/\r\n/", '
',$row['content_tc']);
The results won't work. it's messy in an instant ........
Can I post your code? I feel that your order is wrong.
Can I post your code? It seems that your order is wrong.
foreach ($information as $row) { $row['content_tc']=preg_replace("/[ \t]+/", '',$row['content_tc']); $row['content_tc']=preg_replace("/\r\n/", '
',$row['content_tc']); } $informationAfterHandle[] = $row;
I cannot change the order.
foreach ($information as $row) { $row['content_tc']=preg_replace("/\r\n/", '
',$row['content_tc']); $row['content_tc']=preg_replace("/[ \t]+/", '',$row['content_tc']); } $informationAfterHandle[] = $row;
foreach ($information as $row) { $row['content_tc']=preg_replace("/[ \t]+/", '',$row['content_tc']); $row['content_tc']=nl2br($row['content_tc']); $informationAfterHandle[] = $row;}
foreach ($information as $row) { $row['content_tc']=preg_replace("/[ \t]+/", '',$row['content_tc']); $row['content_tc']=nl2br($row['content_tc']); $informationAfterHandle[] = $row;}
Messy after adding