我有一个字符串PHP截断结束
$description = 'Front: 1 1/2" W x 1" H ... Back: 2 1/4" W x 1 1/4" H Standard Imprint Area is the front. Optional Imprint Area is the back. Imprint on Standard Location Unless Otherwise Specified on Order. For Printing on Both Positions, Add $40.00(G) Set Up Plus .25(G) Per Piece.'
我需要字符串修剪一个具有包含文本“可选的印记”的最后一句句子。
所以,如果文本包含“可选印记”,找到句子的结尾,它的结束点之后抛弃所有的字符,该期(。)。
我需要从上面的例子返回是:
$description = 'Front: 1 1/2" W x 1" H ... Back: 2 1/4" W x 1 1/4" H Standard Imprint Area is the front. Optional Imprint Area is the back.'
你是否总是希望它在第二阶段后修剪?这个文本可以动态吗?提供一点细节。 – 2014-09-19 15:49:54