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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
jenniferG Posted May 11, 2008 Author Share Posted May 11, 2008 Thanks- JG Quote Link to comment Share on other sites More sharing options...
DarkWater Posted May 11, 2008 Share Posted May 11, 2008 No problem. Quote Link to comment 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.