I have a string of text called doc/document1.pdf
. Is there PHP code I can use that will allow me to check if the last 4 characters are equal to '.pdf'?
I am looking for code that looks like this:
<?php if($stringoftext_lastfourcharacters == '.pdf') {
echo "This is a PDF";
}
?>