> I figure the customer isn't going to be too great at replacing tab
> characters with | characters for their flat file upload/export.
>
> I've been trying to find something that will convert tabs in my file
> to | character.
>
> I have tried str_replace, eregi_replace preg_replace and nothing is
> doing it.
>
> (banging head on desk)
>
> str_replace('/\t/', '/|/', $input_file);
> doesn't handle it.
>
> Thank you in advance.
You need to enclose with double quotes since you expect the special characters to be evaluated.
Also, str_replace() doesn't use regex so the slashes are out too.
str_replace("\t", "|", $input_file);
It does look as if str_replace() will accept an array as its subject.
http://www.php.net/str_replace
James
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
YAHOO! GROUPS LINKS
- Visit your group "php-list" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
