ajsie
ajsie

Reputation: 79806

remove quotes from variable in javascript?

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?

Upvotes: 0

Views: 5612

Answers (2)

Annie
Annie

Reputation: 6631

str = str.replace(/"/g, '');

Upvotes: 6

Sarfraz
Sarfraz

Reputation: 382861

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

PHPJS

Upvotes: 1

Related Questions