dongliechuich10319 2012-03-05 05:56
浏览 25
已采纳

PHP Wordwrap在一个角度,每次突破增加缩进

is it possible with php's wordwrap to add increased indentation each line break to essentially create wordwrapping on an angle?

  • 写回答

2条回答 默认 最新

  • dongou0524 2012-03-05 06:06
    关注

    If I understand your question correcly, you would like to produce an output like:

    xxxxxxx
    xxxxxxxxx
    xxxxxxxxxxx
    xxxxxxxxxxxxx
    xxxxxxxxxxxxxxx
    

    Obviously, replacing x with your text.

    wordwrap built-in function does not support this feature but you still can write your own, with a simple loop. Change the max length on each iteration, and break your initial string (depending on your needs, where you find a space or wherever you want).

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

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程