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":) 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] 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
Archived
This topic is now archived and is closed to further replies.