GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Can someone help with a PHP problem? (https://gfy.com/showthread.php?t=1105886)

Mr Pheer 04-09-2013 07:18 PM

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 04-09-2013 07:29 PM

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

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

Mr Pheer 04-09-2013 07:46 PM

Quote:

Originally Posted by jimmycastor (Post 19570447)
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

shake 04-09-2013 08:00 PM

You can always try posting it on stackoverflow - you'll probably get a fix in minutes.

Mr Pheer 04-09-2013 08:52 PM

Quote:

Originally Posted by shake (Post 19570466)
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...

Mr Pheer 04-09-2013 09:01 PM

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.

Mr Pheer 04-09-2013 09:12 PM

Quote:

Originally Posted by jimmycastor (Post 19570447)
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.

shake 04-09-2013 10:00 PM

Glad you got it fixed

Freedom6995 04-10-2013 04:14 AM

Quote:

Originally Posted by Mr Pheer (Post 19570529)
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...

Antonio 04-10-2013 05:17 AM

Quote:

Originally Posted by shake (Post 19570466)
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


All times are GMT -7. The time now is 10:58 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123