Transform A Select Tag to an Array in PHP

In our previous post we explained how to use EditPlus to transform a list of values into an array. This time we will show you how to transform a <select> tag and its options <option> into an array. By doing this, you can easily convert a list of values from a web page into an array to use in your own applications.

First, you need to get an overall idea what we did in our previous post.

Then, just modify the first step and use this rule to replace a regular expression:

Find What: ^(.*)value="([0-9]*)">(.*)</option>
Replace With: \3

image

Advertisement

Did you like it?

No comments yet.

Leave a Comment