---
title: "problem in getting the value from array by using foreach loop"  
description: "problem in getting the value from array by using foreach loop"  
author: "sourabh kumar"  
published: 2011-03-01  
updated: 2011-03-01  
canonical: https://www.mindstick.com/forum/182/problem-in-getting-the-value-from-array-by-using-foreach-loop  
category: "php"  
tags: ["php"]  
reading_time: 1 minute  

---

# problem in getting the value from array by using foreach loop

how we get the [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) from [array](https://www.mindstick.com/articles/335/jagged-array-in-c-sharp-dot-net) by using [foreach loop](https://www.mindstick.com/forum/155785/how-to-use-foreach-loop-in-mvc-razor-view)?\
give the example\

## Replies

### Reply by Amit Singh

hi guys,\
in php, we assign the array as\
$strName = array( "rajiv", "david", "taylor", "mark" );\
\
and get the value by using the [foreach](https://www.mindstick.com/forum/33870/how-parallel-foreach-works-internally) loop as\
foreach($name as $strName)\
{\
echo $name ."</br>;\
}\
\
\


---

Original Source: https://www.mindstick.com/forum/182/problem-in-getting-the-value-from-array-by-using-foreach-loop

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
