Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
<?php $str = 'Hello, World!'; echo strlen($str); // 13 echo strtolower($str); // hello, world! echo strtoupper($str); // HELLO, WORLD! echo substr($str, 7, 5); // World echo str_replace('World', 'PHP', $str); // Hello, PHP! // substr with negative offset counts from the end echo substr($str, -6); // orld! (last 6 chars... wait: World! = 6)
Result
Open