Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
テキスト付きの変数があります:
$text = 'I use something similar to pull the most recent post from my blog and display a snapshot of it on my home page.';
このテキストの最初の40個の記号を取り除く方法は?(スペースを含む)。
このように動作するはずです:
echo strip_text($text, 40);
ありがとう。
とsubstr:
substr
echo substr($text, 40);
PHPのsubstrを使用します:
$stripped = substr($text, 0, 40);