LoginSignup
0
0

PHPで先頭の文字列を取得する方法

Posted at

はじめに

私は株式会社qnoteにて、勉強会の幹事を務めております。
2023年度勉強会の珠玉のネタを2023Qiitaアドベントカレンダーに投稿していこうと思います。

対象者

この記事は下記のような人を対象にしています。

  • 駆け出しエンジニア
  • プログラミング初学者

結論

[0]で簡単に先頭の文字を取得できます。

解説

$text = 'Hello World!!!'
print $text[0]; // [0]で先頭の文字にアクセスできる!

// 結果
H

おわりに

PHPで先頭の文字列を取得する方法についてまとめました。

参考記事

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