Forum Moderators: coopster
Can anyone please help me with ereg_replace coding, or other php code, to achieve this. I just cannot make sense of the vast amount of material around.
The variable containing the data to be stripped of all spaces is $buscode.
Thanks!
In most cases, anywhere you need to use ereg functions, there is probably a preg_match alternative you can use. The preg_match functions are also faster.
In THIS case however - you don't need either.
How about this:
$newvar = str_replace(' ', '', $buscode);
Very simple.
Ok ok ok, here's how you do it with ereg and preg:
ereg_replace(' ', '', $buscode);
preg_replace('/ /', '', $buscode);
preg is a "perl compatible regular expression".