I wants to divide the string in table and my need is
output:
// First Output
$name ='aaaa';
$first='DUT.A1';
$second='E3.3 H2.3 Y3.333 h88.h fdfd.87';
$third ='J66.H3';
// SecondOutput
$name ='bbbb';
$first='DUT.A2';
$second='F2.2 F3.1 Y1.1';
$third ='J30.A1';
Input:
$a = "aaaa ; DUT.A1 E3.3 H2.3 Y3.333 h88.h fdfd.87 J66.H3";
$b = "bbbb ; DUT.A2 F2.2 F3.1 Y1.1 J30.A1";
$c = "cccc ; DUT.A3 H2.3 Y3.333 h88.h Y1.1 J45.G2";
A use explode function to divide the variable like
$exp = explode(";",$a);
$name = $exp[0];
$x = $exp[1];
$x1 = explode(" ",$x);
$total = count($x1);
$first = $x1[1];
$loop_end = $total-2;
for($i=2;$i<=$loop_end;$i++) {
$second .= $x1[$i]."";
}
$third = $x1[$total-1]
;
Using to display Above output.
if i give,
$var = "haha ; J1.A1 DUT.A1 DUT.A2 C1.1 C2.1 ,
F2.1 F4.1 K1.1 ,
F2.1 F4.1 K1.1 ,
F2.1 F4.1 K1.1 ";
I wants Before Semicolon as name, String like DUT.xx as first(no spaces included ex.DUT.A1 DUT.A2)
The Character starts with J and After Numeric value it stored in third(ex.J1.A1 as third
not J after Character). Balance Characters stored in variable Second, like (ex.
$second = 'C1.1 C2.1,F2.1 F4.1 K1.1,F2.1 F4.1 K1.1,F2.1 F4.1 K1.1';
)
codebutton in the editor, not HTML code. Second, please rephrase the question. It's hard to understand what exactly you are asking.