Results 11 to 16 of 16
-
8th Mar 2012, 01:19 AM #11(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comHe said he wanted to convert a given string to the '\x[0-9a-f]{2}' form (which javascript uses, not PHP), which is what both you and I gave working functions for.
As mentioned in my previous post, I was merely giving an example of an alternative, more modern way you could do it using PHP 5.3. I never stated it was the best way in terms of portability.
Every developer knows what language uses the '\x' representation, which is why my assumptions were made. In which case, what I said about needing one occurrence per character remains true. You can also see this from his initial example where he uses it on a per-character basis, implying it is a javascript string or similar.
Have a good day Lock Down, don't be so defensive in future, remember it was just a response.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
8th Mar 2012, 03:49 AM #12Respected Member
My bad then as I thought he mentioned php.
So I think you should give him the exact code needed to convert it with javascript.
-
8th Mar 2012, 10:58 AM #13(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comIt seems like he wanted a PHP solution to the problem, just the string he's trying to convert to appears to be a javascript string.
What does it matter though, he has the answer now, twice lol.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
8th Mar 2012, 03:56 PM #14Respected Member
Where was the twice.
Your function with no reference to the rest of the code posted was not an answer and you should really finish what you start.
Let's see the the javascript answer to the question. I am sure he could use it as other members.
Shouldn't take you but a few minutes for a working tested solution.
-
8th Mar 2012, 07:45 PM #15(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comI didn't feel the need to reference the rest of the code as you had already posted it previously, this was simply a potential replacement for the function in that code. Since there was only one function in use, it seemed obvious to me that would be the one to replace. I did finish, thanks to the rest of the code already existing due to your post.
As for the javascript, he asked for it in PHP, not JS. But for your satisfaction:
Code:var str = 'some string'; str = str.replace(/./g, function(c) { return '\\x' + c.charCodeAt(0).toString(16); }); // str now contains the characters using '\x' notation
Doing something like the following would result in the '\x' codes being evaluated, leading to the initial string.
Code:str = str.replace(/./g, function(c) { eval("c = '\\x" + c.charCodeAt(0).toString(16) + "';"); return c; });
Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
9th Mar 2012, 03:44 PM #16Respected Member
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
How to Encode Like this..??
By downloadsmasti in forum Tutorials and GuidesReplies: 21Last Post: 10th Nov 2012, 10:20 PM -
Encode to html
By skinner in forum Web Development AreaReplies: 4Last Post: 21st Feb 2012, 02:28 PM -
Need RDP to encode
By TheLorenalex in forum Hosting DiscussionReplies: 9Last Post: 25th Nov 2011, 06:08 PM -
how to encode a movie
By chaudhary9 in forum General DiscussionReplies: 2Last Post: 24th Sep 2011, 11:27 PM -
Need VPS for encode
By chipve in forum Hosting DiscussionReplies: 4Last Post: 2nd Feb 2011, 03:26 PM
themaPoster - post to forums and...
Version 5.23 released. Open older version (or...