# \[PHP\] Obtain Data from String

**URL:** <https://forum.kirupa.com/t/php-obtain-data-from-string/255781>\
**Category:** programming\
**Created:** [March 26, 2008, 9:42pm UTC](https://forum.kirupa.com/t/php-obtain-data-from-string/255781 "2008-03-26T21:42:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nobody](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nobody](https://forum.kirupa.com/u/nobody)\
**Post date:** [March 26, 2008, 9:42pm UTC](https://forum.kirupa.com/t/php-obtain-data-from-string/255781/1 "2008-03-26T21:42:14Z")

</div>

I’m sure there’s a name for what I’m trying to do, but I’m at a loss here.

So I’m working on a text replacement script for something I’m working on. Basically I’ll have something like this:

> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec nisi lacus, egestas sed, hendrerit id, gravida iaculis, dolor. **{a409ndk32|small|left|Hey There}** Aliquam consectetuer, turpis in sollicitudin sodales, massa eros cursus turpis, in vulputate diam nisi eget erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean mollis mi nec velit. Nam pellentesque nisi vitae ipsum. Proin risus. **{sd90f32kd|large|right|What Up?}** Donec tristique felis nec augue. Nulla arcu elit, condimentum sit amet, rhoncus sit amet, consectetuer ac, tortor.

Notice the information in the brackets (such as {a409ndk32|small|left|Hey There}). Somehow I need to strip out each of the four items and be able to manipulate them. Perhaps pull them out as an array because it could be 1 to 100 of these at any time.

I assume this is a regex thing and unfortunately I don’t know anything about regex.

Any thoughts or help?
