Results 1 to 3 of 3
  1. #1
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Ok I give up
    I am trying to replace (actually delete) a string in a product name. Here is what I have.

    PHP Code:
    $string $iName;
                    
    $pattern '/MyTargetWord/';
                    
    $replacement '';  // this is two single quotes
                    
    $iName preg_replace($patterns$replacement$string); 

    The above code is results in an empty string error.

    Any help is greatly appreciated.
    Thanks,
    Doug

  2. #2
    Believe knight01's Avatar
    Join Date
    August 14th, 2006
    Location
    Dayton, Ohio
    Posts
    1,815
    Quote Originally Posted by itsupportnotes
    I am trying to replace (actually delete) a string in a product name. Here is what I have.

    PHP Code:
    $string $iName;
                    
    $pattern '/MyTargetWord/';
                    
    $replacement '';  // this is two single quotes
                    
    $iName preg_replace($patterns$replacement$string); 
    Any help is greatly appreciated.
    Could it be singular vs. plural for $pattern vs. $patterns
    Last edited by knight01; July 10th, 2008 at 11:55 AM. Reason: bolding doesn't work in php code
    Someday starts today
    Military Discounts

  3. #3
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Quote Originally Posted by knight01
    Could it be singular vs. plural for $pattern vs. $patterns
    Man, I change that on the $replacement(s) but forgot the pattern. Let me see.

    Yup that was it. Glad I kinda know what I was doing but could smak myself for the oversite.

    Thanks
    Thanks,
    Doug

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Featured: When You Want To Give Up
    By Can-Do Attitude in forum Newbie Affiliate FAQs & Helpful Articles
    Replies: 17
    Last Post: March 31st, 2015, 10:34 AM
  2. I give up!
    By zboostnet in forum ShareASale - SAS
    Replies: 12
    Last Post: August 15th, 2006, 06:45 AM
  3. about to give up!
    By sa00 in forum Introduce Yourself
    Replies: 16
    Last Post: November 8th, 2004, 06:57 AM
  4. I give up!
    By Heyder in forum Search Engine Optimization
    Replies: 13
    Last Post: September 25th, 2002, 10:25 PM

Posting Permissions

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