Hey guys i had an idea yesterday. Can you help me with this. Here is the code
foreach($categoriesDetail as $categories)
{
foreach($subCategoriesDetail as $subCategories)
{
if($categories->id == $subCategories->cat_id)
{
foreach($teamsDetail as $team)
{
if($subCategories->id == $team->sub_cat_id)
{
echo $team->name;
}
}
}
}
}
The will will run and produce the correcr result but i want extra iteratinos not to run. In other words
foreach($categoriesDetail as $categories)
{
foreach($subCategoriesDetail as $subCategories where $categories->id == $subCategories->cat_id)
{
foreach($teamsDetail as $team where $subCategories->id == $team->sub_cat_id)
{
echo $team->name;
}
}
}
I know this is not possible in php or any other language but i want an alternative or may be in future they may add this to increase performance.