Ok I have 3 arrays in a table after an explode which contains these values:
$line[1] = Dauksa
$line[2] = Emmanuel
$line[3] = EIMP
$line[4] = Department of Test
$line[5] = Montreal
$line[6] = Canada
$line[1] = Howlett
$line[2] = Liam
$line[3] = EIMP
$line[4] = Department of Test
$line[5] = Montreal
$line[6] = Canada
$line[1] = Flint
$line[2] = Keith
$line[3] = EIMP
$line[4] = Department of Test
$line[5] = Montreal
$line[6] = Canada
I would like to store in a variable called Co_Authors_Last_Name the values taken from $line[1] for each array.
Basically, Co_Authors_Last_Name should have stored values of Dauksa Howlett and Flint
How do I do this?
Here is the code I started on:
foreach ($_POST['AbstractAuthors'] as $row => $value)
$no_co_authors++;
if ($no_co_authors > 0) // If number of co-authors > 0
{
// The code below explodes a complicated string into 6 values indicated above.
foreach ($_POST['AbstractAuthors'] as $row => $value)
{
$pres_author = substr($value, -28);
$pres_author_true = strcmp("isPresentingAuthor{{{true}}}", $pres_author);
if ($pres_author_true != 0)
{
$line = explode("{{{", $value);
for($x = 0; $x < count($line);++$x)
{
$line[$x] = substr($line[$x],0,strpos($line[$x],"}}}"));
}
}
}