0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

タグを除去して文字列の一部取り出し

0
Posted at
  • strip_tags 文字列からタグを取り除く
  • mb_substr 日本語を含む文字列から文字列を一部を取り出す
mb_internal_encoding('UTF-8');
$string = 'タグと日本語を含む文字列';

// 文字列からタグを取り除く
$string = strip_tags($string);

// 日本語を含む文字列から文字列を一部を取り出す
$string = mb_substr($string,0,100);

echo $string;
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?