troubleshooting Question

Converting this string to an array

Avatar of Alex Lord
Alex Lord asked on
PHP* arrays
3 Comments1 Solution96 ViewsLast Modified:
<div id='property-2565' class=' col-md-4'><label style='float:left;' class ='control-label' for='2565'>textline2</label><input class='form-control' type='text' name='property-2565' id='property-2565' value='test1'/></div><div id='property-2561' class=' col-md-4'><label style='float:left;' class ='control-label' for='2561'>select1</label><select style ='width:100%;' class='form-control' name='property'2561'' id='property'2561''><option value=''>- select -</option><option value='1' >1</option><option value='2' >2</option><option value='3' >3</option></select></div><div id='property-2555' class=' col-md-4'><label style='float:left;' class ='control-label' for='2555'>textline1</label><input class='form-control' type='text' name='property-2555' id='property-2555' value='test3'/></div>

so here is my lovely string which is exactly 3 separate divs with two inputs and a select.

my question is it possible or how can i transfer this string into an array to display these 3 divs separately as a array.


like so

0 => <div id='property-2565' class=' col-md-4'><label style='float:left;' class ='control-label' for='2565'>textline2</label><input class='form-control' type='text' name='property-2565' id='property-2565' value='test1'/>
1 => <div id='property-2561' class=' col-md-4'><label style='float:left;' class ='control-label' for='2561'>select1</label><select style ='width:100%;' class='form-control' name='property'2561'' id='property'2561''><option value=''>- select -</option><option value='1' >1</option><option value='2' >2</option><option value='3' >3</option></select></div>
2 => <div id='property-2555' class=' col-md-4'><label style='float:left;' class ='control-label' for='2555'>textline1</label><input class='form-control' type='text' name='property-2555' id='property-2555' value='test3'/></div> 
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros