douhuai4155 2010-02-09 09:32
浏览 29
已采纳

根据语言使用php包装文本

My problem is that I have quite a small area (div or span), in which one to about five words are displayed. However, the area is too small for some words (for instance "muziekgeschiedenis" will surpass the area's bounds). Is there a way in PHP to wrap this word, but not solely based on number of characters? I can use wordwrap(), or just CSS properties for wordwrapping, but that may wrap this word into "muziekgeschiedeni-s", which is not wanted. It should break into for instance "muziekgeschiede-nis", based on syllables. Are there any PHP extensions that support word breaking/wrapping like this?

Thanks!

  • 写回答

4条回答 默认 最新

  • doubaoguo7469 2010-02-09 09:37
    关注

    this is called "hyphenation" and this is the first link that google gives on "php hyphenation"

    http://yellowgreen.de/phphyphenator

    hope this helps

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal
  • ¥20 OPENVPN连接问题