日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php分开每个字,PHP,分解每个句子之间有特殊字符的文本文件

發布時間:2025/3/20 php 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php分开每个字,PHP,分解每个句子之间有特殊字符的文本文件 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我有一個帶有Unicode編碼的文本文件(有時它包含一個希伯來語),其內容是文本,在每個句子之間有一個像這樣的兩個特殊字符(■■)(alt + 2 + 5 + 4),這是一個示例

"How are you, It's a cool day .. how can I read this sentence in a string variable with the quotes."■■

"This is second sentence I want it in another variable or in second cell in array."■■

This is third sentence. It is without quotes I want to read it to a string.■■

This is fourth sentence it includes an enter,

The fourth sentence isn't completed right yet.

The sentence doesn't completed until the special character is appears,

Maybe there a lot of lines in the same sentence.

This is the last part of the sentence■■

"This is the fifth sentence", this is the second part of the fifth sentence■■

Maybe between every two sentences there is a lot of empty lines, This is the sixth sentence■■

Thanks I wish anyone can help me with this, This is the last sentence■■我對這個代碼,但它不起作用:

$file=file_get_contents("text_file.txt");

$file_= urldecode($file);

$sentences = explode('■■',$file_);

?>當我為第一句(我沒有把所有文件放在簡單的閱讀文件中)制定指定的代碼時,我會得到

Array ( [0] => ��"How are you, It s a cool day .. how can I read this sentence in a string variable with the quotes."�%�%并獲得相同的其他句子..(我看到在同一行中的所有句子)我的意思是沒有進入

另一件事,我想忽略兩句話之間的界限,我的意思是忽略■■后面的空行

總結

以上是生活随笔為你收集整理的php分开每个字,PHP,分解每个句子之间有特殊字符的文本文件的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。