Php how to extract key values containing different strings from the array and cyclically replace returns the structure of a new array data table if $ a = array (nsk-aaayb, MP-00A00uk-000), output nsk-aaa0F, MP-00A00IO-000nsk-aaa0F, MP-00A00F0-000nsk-php how to extract key values containing different strings from the array and return a new array with a replacement loop
The data table structure is
If $ a = array (nsk-aaayb, MP-00A00uk-000), output
Nsk-aaa0F, MP-00A00IO-000
Nsk-aaa0F, MP-00A00F0-000
Nsk-aaa1F, MP-00A00SA-000
And so on ..
If $ a = nsk-aaayb, output
Nsk-aaa0F
Nsk-aaa0F
Nsk-aaa1F
And so on ..
Which of the following heroes can help you solve the problem? thank you first.
------ Solution --------------------
$query=mysql_query("select * from table");
while ($row = mysql_fetch_array($query)) {
if(is_array($a)) {
echo 'nsk-aaa'.$row['darfon'].',MP-00A00'.$row['chicony'].'-000';
} else if(is_string($a)) {
echo 'nsk-aaa'.$row['darfon'];
}
}
That's what it means...