Results 1 to 7 of 7
  1. #1
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    I am trying to remove "" from a datafeed and when I use this below I get
    Parse error: parse error, expecting `')''


    can anybody tell me what I am doing wrong please? I think it is the "" in the first bit but I cannot think of any other way to do it.
    Thanks in advance for any help

    $replace = array("""","#",""","®"," - ","(",")","&");

    BTW is this post 200,000?
    Take care
    YouTrek.com

  2. #2
    ABW Ambassador sjangro's Avatar
    Join Date
    January 18th, 2005
    Location
    Boston
    Posts
    1,529
    Gordon,

    You need to escape the double quotes in the strings in the array, like this:
    <pre class="ip-ubbcode-code-pre">
    $replace = array(
    "\"\"" ,
    "#" ,
    "\"" ,
    "®" ,
    " - " ,
    "(" ,
    ")" ,
    "&"
    );
    </pre>

    I broke it up onto several lines so it would be easier to see where each element of the array begins and ends.

    And I assume your first element is trying to match two consecutive double quotes? If that's just your trying to escape the " like you would in many other programming languages with two double-quotes, then you can get rid of it because you've got the "\"" in there already.

    --
    scott@befree.com

  3. #3
    pph Expert! Gordon's Avatar
    Join Date
    January 18th, 2005
    Location
    Edmonton Canada
    Posts
    5,781
    Thank you Scott

    I never thought about the \

    BTW is this post 200,000?
    Take care
    YouTrek.com

  4. #4
    ABW Veteran Student Heyder's Avatar
    Join Date
    January 18th, 2005
    Posts
    5,482
    Nice sig line Gordon lmao

  5. #5
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    sTrl
    Posts
    1,372
    You could also have used '""'

    spaced out version :: '..."..."...'

  6. #6
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,015
    Geez, Pete, don't confuse the poor lad..

    --
    "The greatest good you can do for another is not just to share your riches, but to reveal to him his own." – Benjamin Disraeli
    --
    Ford Fox-body Owners Club -- http://www.ford-fox.org

  7. #7
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    Honiara, Solomon Islands
    Posts
    1,085
    I prefer to do it this way:
    <pre class="ip-ubbcode-code-pre"> ereg_replace("[\x27\x22]",'' </pre>

    Removes double and single quotes. Just remove the single quote ASCII if you don't need it. Also you can look up the ASCII for the other CHARS you want to bin. Much less painful.

  8. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Stumped
    By dopey in forum Newbie Affiliate FAQs & Helpful Articles
    Replies: 10
    Last Post: April 10th, 2009, 03:39 PM
  2. I'm Stumped
    By bakerd@neo.rr.com in forum ShareASale - SAS
    Replies: 3
    Last Post: September 8th, 2007, 04:28 PM
  3. Stumped
    By NikoInc in forum Introduce Yourself
    Replies: 5
    Last Post: October 10th, 2006, 09:38 AM
  4. Stumped by Google Results
    By Greg Rice in forum Search Engine Optimization
    Replies: 5
    Last Post: August 10th, 2004, 10:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •