PHP 5 Strings

<?php echo strlen("Hello world!"); // outputs 12 ?> <?php echo str_word_count("Hello world!"); // outputs 2 ?> <?php echo strrev("Hello world!"); // outputs !dlrow olleH ?> <?php echo strpos("Hello world!", "world"); // outputs 6 ?> <?php echo str_replace("world", "Dolly", "Hello world!"); // outputs Hello Dolly! ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.