Home > AI > Language > PHP >

substr

Example: check prefix or suffix

<?php
$a = "st_ai";
if (substr($a, 0, 3) == "st_") {
    echo "good";
};
    ?>

Leave a Reply