PHP Adding “S” To End Of Variable Name – String Function

<?php
            $food = "grapefruit";
            print "These ${food}s aren't ripe yet.";
            print "These {$food}s aren't ripe yet.";
    ?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.