php - Creating If/Else based on URL of page -
basically i'm trying create if/else statement based on url of current site im on. if/else statement going echo list based on alphabetical range. in other words, if url starts letters between (a-g) want echo 1 thing, , if starts letters (h-z) want echo else. script used on many websites. thanks
<?php $uri = strtoupper(isset($_server['request_uri']) ? $_server['request_uri'] : '/cli'); if(ord($uri[1]) <= ord('g')) echo "echo 1 thing"; else echo "echo else";
Comments
Post a Comment