dongtan9066 2012-09-03 13:01
浏览 41
已采纳

似乎无法摆脱mysql中新的空白行

EDIT:

For those having issues with mysql data that won't get rid of white spaces between rows. It's because of deep tabbed indents due to an issue when copy pasting from editors/word documents.

http://bugs.mysql.com/bug.php?id=49611

Here is the bug that doesn't allow me to fix this issue, it's because of deep indents, it's a MYSQL bug that won't be fixed.

PS: Message to community, Thanks to the guys that downvoted this question without giving time to properly formulate the issue. It's a debug process, you can let people know if you need something instead of acting rude and attacking the questioner, after all as the poster I'm likely to read and see what you need. If I knew what was needed to diagnose the issue, I would've found it and would not be posting here. Since I posted here, it means I don't know where to look as to identify if the issue is a MYSQL one or a PHP one. Be polite with your community guys, don't act like wolves trying to bite someone's head off all the time because they didn't give you everything you wanted right off the bat.. Take care.


Here is the raw paste from the database:

    one two three











one two three





one two three





one two three





one two three

Why is it still being like this? I str_replaced  's and 's . I don't want to get rid of 2 's due to the format of the text I need in between the text.

The result I'm looking for is :

 one two three

 one two three

 one two three
 one two three

Meaning max 2 's.

  • 写回答

1条回答 默认 最新

  • douyeke2695 2012-09-03 13:05
    关注

    This might be what you are after:

    $normalized = preg_replace('~(?
    ?){3+}~', "
    
    ", $original);
    

    But hey, it's hard to say. You want to keep stack overflow a happy place, you put some effort to posting a question.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100