A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: php squares[]appear instead of spaces for excel sheets

  1. #1
    Member
    Join Date
    May 2003
    Posts
    80

    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.

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    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

  3. #3
    Member
    Join Date
    May 2003
    Posts
    80
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center