sstangle73 Posted April 23, 2009 Share Posted April 23, 2009 <?php if (ereg($team, 'BU')) { $team2 = str_replace("BU", "Boys U", $team); } else { $team2 = str_replace("GU", "Girls U", $team); }?> how do i get it so that if $team contains 'BU' it will change BU to Boys U and if it has GU it will change it to Girls U Link to comment https://forums.phpfreaks.com/topic/155291-solved-string-contains/ Share on other sites More sharing options...
ballhogjoni Posted April 23, 2009 Share Posted April 23, 2009 you are using ereg wrong! ereg('BU', $team). also its better to use eregi because its case insensitive. Link to comment https://forums.phpfreaks.com/topic/155291-solved-string-contains/#findComment-817014 Share on other sites More sharing options...
sstangle73 Posted April 23, 2009 Author Share Posted April 23, 2009 wow its been along night i havent coded like 3 lines lol thanks! Link to comment https://forums.phpfreaks.com/topic/155291-solved-string-contains/#findComment-817017 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.