Can someone help with a PHP problem?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mr Pheer
    So Fucking Banned
    • Dec 2002
    • 22083

    #1

    Can someone help with a PHP problem?

    So I've got this piece of code that wont play nice.

    Code:
    preg_match_all("/(\{\[)([\w-\d\s\.\|']*)(\]\})/i",$replace_text, $match);
    What it is supposed to do, is allow an apostrophe to be in my replacement text. So in my text, where i have "{[SPIN--they are|they?re]}" it should return "they are" or "they're".
    But instead, it simply does nothing and spits out the entire spintax code just as I typed above.

    The only time this does not work, is when a replacement text has an apostrophe. It works perfectly everywhere else. Been trying to fix this for two days and I'm about to throw my keyboard through my fucking monitor.

    Can someone help, please?
  • jimmycastor
    So Fucking Banned
    • Jul 2006
    • 342

    #2
    not sure but i see this ' one --> here in this part |']*) ..that could be the problem,

    try using ´ instead of ' ..see the difference ??

    Comment

    • Mr Pheer
      So Fucking Banned
      • Dec 2002
      • 22083

      #3
      Originally posted by jimmycastor
      not sure but i see this ' one --> here in this part |']*) ..that could be the problem,

      try using ´ instead of ' ..see the difference ??
      Thanks... but that gives me the same result as before

      Comment

      • shake
        frc
        • Jul 2003
        • 4663

        #4
        You can always try posting it on stackoverflow - you'll probably get a fix in minutes.
        Crazy fast VPS for $10 a month. Try with $20 free credit

        Comment

        • Mr Pheer
          So Fucking Banned
          • Dec 2002
          • 22083

          #5
          Originally posted by shake
          You can always try posting it on stackoverflow - you'll probably get a fix in minutes.
          I got a sarcastic remark there within minutes.

          Damn, and I used to thing GFY was a rough place...

          Comment

          • Mr Pheer
            So Fucking Banned
            • Dec 2002
            • 22083

            #6
            Fuck, who knew there are three different apostrophes on your keyboard? If you dont use the right one in the code, the shit wont work.

            I'm going to get some glasses tomorrow.

            Comment

            • Mr Pheer
              So Fucking Banned
              • Dec 2002
              • 22083

              #7
              Originally posted by jimmycastor
              not sure but i see this ' one --> here in this part |']*) ..that could be the problem,

              try using ´ instead of ' ..see the difference ??
              I cut and pasted yours but it didnt work... someone on stackoverflow posted one that looks the same to me, I cut & pasted that one, and it worked.

              Comment

              • shake
                frc
                • Jul 2003
                • 4663

                #8
                Glad you got it fixed
                Last edited by shake; 04-09-2013, 09:02 PM. Reason: edit - getting tired and missread that...
                Crazy fast VPS for $10 a month. Try with $20 free credit

                Comment

                • Freedom6995
                  Friends of Venus founder
                  • Jul 2010
                  • 1975

                  #9
                  Originally posted by Mr Pheer
                  Fuck, who knew there are three different apostrophes on your keyboard? If you dont use the right one in the code, the shit wont work.

                  I'm going to get some glasses tomorrow.
                  Found that out the hard way myself. Ditto on the glasses...

                  Comment

                  • Antonio
                    Too lazy to set a custom title
                    • Oct 2001
                    • 14136

                    #10
                    Originally posted by shake
                    You can always try posting it on stackoverflow - you'll probably get a fix in minutes.
                    sometimes it takes days and many questions go unanswered too; when you get stuck on bigger issues, fiverr is your best friend

                    Comment

                    Working...