Title: String manipulation
Last modified: August 19, 2016

---

# String manipulation

 *  [nicholasreed](https://wordpress.org/support/users/nicholasreed/)
 * (@nicholasreed)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/string-manipulation/)
 * I will be dealing with a **big string that contains various html elements with
   attributes.**
 * My ultimate goal is to get src=”**pictureaddress**” out of the <img> elements
   the big string contains,
    and then add the contents of the src=”” (an image address)
   to the database.
 * The string might contain any html element/tag, and quite some random characters.
 * for example the big string could be:
 *     ```
       <img class="alignnone size-medium wp-image-71" title="5bwallcoo_com5d_photobook_horikitam1" src="http://localhost/wordpress/wp-content/uploads/2008/09/5bwallcoo_com5d_photobook_horikitam1-300x225.jpg" alt="" width="300" height="225" /><img class="alignnone size-medium wp-image-73" title="normal_maki-horikita-0098-92784" src="http://localhost/wordpress/wp-content/uploads/2008/09/normal_maki-horikita-0098-92784-300x225.jpg" alt="" width="300" height="225" />
       [caption id="attachment_72" align="alignnone" width="265" caption="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"]<img class="size-medium wp-image-72" title="maki" src="http://localhost/wordpress/wp-content/uploads/2008/09/maki-265x300.jpg" alt="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" width="265" height="300" /><img class="alignnone size-medium wp-image-70" title="4f04e9a0102900_full1" src="http://localhost/wordpress/wp-content/uploads/2008/09/4f04e9a0102900_full1-300x225.jpg" alt="" width="300" height="225" />
       ```
   
 * So our goal is to get these bad boys out, using some sort of for loop, and adding
   each one to the database each time.
 * Thank you very much.
    Nicholas Reed nicholasreed.net

Viewing 1 replies (of 1 total)

 *  [Michael Torbert](https://wordpress.org/support/users/hallsofmontezuma/)
 * (@hallsofmontezuma)
 * WordPress Virtuoso
 * [17 years, 6 months ago](https://wordpress.org/support/topic/string-manipulation/#post-870476)
 * [strings](http://www.w3schools.com/PHP/php_ref_string.asp)

Viewing 1 replies (of 1 total)

The topic ‘String manipulation’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Michael Torbert](https://wordpress.org/support/users/hallsofmontezuma/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/string-manipulation/#post-870476)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
