get a string before the first “.” with php

前端 未结 5 664
执念已碎
执念已碎 2021-01-14 21:40

\"Lorem Ipsum is simply dummy text of the printing and typesetting industry.\"

from

\"Lorem Ipsum is simply dummy text of the printing and typesetting indust

5条回答
  •  耶瑟儿~
    2021-01-14 22:02

    For PHP 5.3 and later you could use the before_needle argument with strstr:

    strstr( $youstringhere, ".", true );
    

提交回复
热议问题