0

I Want to remove a part from string using preg_replace, i searched for long but i couldn't find a way to help me make the correct expression. the string:

test test test test test test test test test test test test test test     test test test test test test test test test test
<div>[[{"fid":"1915134","view_mode":"default","type":"media","attributes": {"height":360,"width":480,"alt":"#some text here","class":"media-element file-default"}}]]</div>
test test test test test test test test test test test test test testtest test test test test test test test test test
test test test test test test test test test test test test

Remove the part start with [[{"fid":" and end with }}]]

1 Answer 1

1

You can use this:

$a = preg_replace('/\[\[{"fid"[^}\]]+}}\]\]/','',$a);
Sign up to request clarification or add additional context in comments.

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.