-3

I have a PHP Script that fetches text from the database, and what I want to do is the following:

If the text from the database looks like this:

[url="something"]Some text[/url]

I want it to look like this:

[url=something]Some text[/url]

I hope you can help me. Thanks

2
  • 1
    Have you tried anything? Commented Apr 30, 2014 at 13:05
  • If you want to change the text within the database to remove the quote, you should take a gander at this answer Commented Apr 30, 2014 at 13:07

2 Answers 2

0

You should use str_replace:

$str = str_replace('"','',$str);
Sign up to request clarification or add additional context in comments.

Comments

0
$text = '[url="something"]Some text[/url]';
echo $text = preg_replace('#\[url="(.*?)"\]#i','[url=$1]', $text);

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.