i have following variable and need to use it in the array loop…
$jointa="'nike-score', 'pack-cupcake', 'shor-burgundy'";
foreach (array($jointa) as $id) {
$yourSiteContent[] = array('permalink' => $id, 'updated' => $dated);
}
but when i put the value direct in array loop its works fine….
foreach (array('nike-score', 'pack-cupcake', 'shor-burgundy') as $id) {
$yourSiteContent[] = array('permalink' => $id, 'updated' => $dated);
}
please check where i am doing mistake?
1 Answer