Php explode in Yii2 project
<p>In my Yii2 project, I have data coming from the database column.
In the database column the data is as follows. </p>

<pre><code>12

13SeeP

2/3 

Seep2
</code></pre>

<p>Here I want to explode the numbers in an array </p>

<ul>
<li>[12] for the first row</li>
<li>[13] for the second row</li>
<li>[2 , 3] for the third row</li>
<li>[2] for the forth row.</li>
</ul>

<p>I am unable to use explode to achieve this.I used trim</p>

<pre><code>  public function classLabelImdg() {
        $imdgLabels = $this-&gt;transportImdg-&gt;imdg_sub_risk;
        $imdgLabelsTrim =  trim(preg_replace("/[^0-9,.\/]/","",$imdgLabels)); 
        $cleanImdgLabels = explode('/',$imdgLabelsTrim);
        $classLabelNo = TransportClass::find()-&gt;where(['class_no'=&gt; $cleanImdgLabels])-&gt;all();
        return $classLabelNo;   
    }
</code></pre>

<p>The above is doing what i want to but now it is rearranging my data in the array.. I want them to be dispalyed in the same order.</p>

<p>How do  I achieve my result any help??</p>

<p>Thank you</p>