0

I really don't understand Javascript.

In PHP, I can remove quotes like this:

$tags_array = preg_replace('/"/', '', $tags_array);

How do I write it in Javascript?

1
  • Do you mean "remove quote from an array of string"? You'll have to loop through the array to do it. Commented Dec 22, 2009 at 6:40

2 Answers 2

6
str = str.replace(/"/g, '');
Sign up to request clarification or add additional context in comments.

2 Comments

The quote doesn't needs to be escaped, /"/g will be enough :)
PHP's preg_replace accepts array of strings or a single string, so .replace is not a direct replacement for that.
1

You can do almost the same thing with javascript what you do with php, i mean many functions, here is the solution:

PHPJS

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.