-
php squares[]appear instead of spaces for excel sheets
I am working on an excel sheet import. It imports the sheet perfectly fine, but it seems like all of the spaces are squares [] empty[]hollow[]squares. I've used $mystring = str_replace('�', ' ', $mystring); to replace it with a space, but it doesn't seem to work. It is interesting that here the square appears as a diamond with a ? in it.
Sure I could remove all of the spaces from the excel sheet, but that wouldn't solve the overall problem.
Any help is much appreciated. I've looked on other forums and found nothing.
-
Hi,
could be something like nonbreakable space instead of real space.
If you do not expect umlaut or accent characters, you could try
Code:
ereg_replace('[\200-\377]', ' ', $mystring)
to turn every unexpected char into a space
Musicman
-
Thank you so much for the help, but unfortunately it kept the [] and removed the capitolized letters and word. I don't know what's wrong with this. Maybe its an Excel 2010 csv export fault.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|