Unleash the Power of Each: Embrace the Foreach! You can use the  for loop to iterate through an array, but to really shine, you need to use the  foreach loop. The foreach loop has the following syntax. foreach ($array as $key => $value) You’ll read the structure like this: For each array as key/value … or For each key/value pair inside of an array. It means that the foreach loop will loop through each array element and you will have access to each key/value pair of each element. This is great if you’re dealing with associative arrays. If the key is a string, you will not be able

Data is a critical asset for any organization, and managing it effectively is essential for driving business value and achieving competitive advantage. As such, CIOs need to play a key role in ensuring that their organizations are managing data effectively. This article highlights some of the things that CIOs need to do with data. Develop a data management strategy The first step for any CIO in managing data effectively is to develop a data management strategy. This strategy should outline how the organization will manage data, including how it will be collected, stored, secured, analyzed, and used. The strategy should

Loop it up: Unleash the power of for loops! I use for loops way more than I use  while loops. It seems like most of the time I’m reading items from a database:  for loops are perfect for that. I tend to use while loops in Java programs where I need to execute some code until the program terminates; that’s not realistic in PHP. In web-programming, I almost exclusively use for and foreach loops. In most programming languages, the for loop follows the following syntax: for (exp_before; exp_before_loop_body; exp_after) { loop_body } Once PHP encounters the for loop, it looks at the expression exp_before to initialize the necessary variables that are required by the loop. When

What do you do while Doing Do-While Loops? A regular while loop will skip over the loop body if the expression that’s evaluated is never true. But what if we need the contents of the body to be executed at least once? That’s what the  do-while loop does for us. <?php $will_execute = false; while ( $will_execute ) { echo “I will execute at least once”; } ?> Looking at the code above, the while loop will never execute since the expression is always false. PHP will just skip over it. In this example, we want the statement to execute at least once. We want PHP to

Regardless of the intention, if you come into an organization outside of an IT role and immediately divert your attention towards IT, you will be judged. The IT department is there to assist other departments, no question about that. I don’t want you to think that we’re talking about people that need tools in order to perform their jobs. No, these are the individuals that will write you an email on day one of starting their position and tell you exactly what IT needs to do to improve the organization. The other group is the group that’s barely holding on

This Might take a While If you’ve never been introduced to the concept of a loop, think about it this way. Let’s say that you’re looking at an excel sheet. In that excel sheet you have rows that go down the sheet. Each row has some data inside of it. To read the contents of the next row, you move down. You can keep reading the contents of each row up until you reach the last row of that excel sheet. With a loop, you can read the information from a particular row, add 1 to the current row number,