markspec87 Posted July 21, 2006 Share Posted July 21, 2006 This is a follow on from my previous post but i thought its essentially a different question.I got my variable $domain. How do i check that to see if it contains .co.uk or .net for example?I.e "IF $domain contains .co.uk then price = 5.99 else price = 7.99":) Quote Link to comment https://forums.phpfreaks.com/topic/15265-checking-a-string-for-a-value/ Share on other sites More sharing options...
spyke01 Posted July 21, 2006 Share Posted July 21, 2006 from http://us3.php.net/manual/en/function.stristr.php[code]<?php $string = 'Hello World!'; if(stristr($string, 'earth') === FALSE) { echo '"earth" not found in string'; }// outputs: "earth" not found in string?> [/code] Quote Link to comment https://forums.phpfreaks.com/topic/15265-checking-a-string-for-a-value/#findComment-61683 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.