jenniferG Posted May 10, 2008 Share Posted May 10, 2008 We are trying to concaenate multiple spaces tpo one space with the following: $instr= 'John Smith'; $xx=str_replace('/\s+/',' ',$instr); print $xx; exit; it removes all spaces and returns $xx as one string. Jennifer Link to comment https://forums.phpfreaks.com/topic/105081-blank-removal/ Share on other sites More sharing options...
DarkWater Posted May 10, 2008 Share Posted May 10, 2008 $instr= 'John Smith'; $xx = ereg_replace("( )+", " ", $instr); echo $xx; Try that. Link to comment https://forums.phpfreaks.com/topic/105081-blank-removal/#findComment-537931 Share on other sites More sharing options...
jenniferG Posted May 11, 2008 Author Share Posted May 11, 2008 Thanks- JG Link to comment https://forums.phpfreaks.com/topic/105081-blank-removal/#findComment-537941 Share on other sites More sharing options...
DarkWater Posted May 11, 2008 Share Posted May 11, 2008 No problem. Link to comment https://forums.phpfreaks.com/topic/105081-blank-removal/#findComment-537944 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.