👾 Subiendo de nivel con PHP / Leveling Up with PHP 👾
Español
¡Hola, comunidad de Hive!
Hoy quiero compartir una experiencia diferente: una sesión de aprendizaje en la que estuve practicando programación con PHP. En esta ocasión, el reto no consistió en superar una partida, sino en comprender cómo organizar instrucciones y corregir errores para completar varios ejercicios.
Durante la práctica trabajé con variables, ciclos, arreglos y condicionales. Aunque algunos conceptos me hicieron detenerme y revisar varias veces el código, terminar los ejercicios me dejó una gran satisfacción. Lo más importante fue que no me limité a copiar una solución: fui escribiendo, preguntando y corrigiendo hasta entender mejor cada parte.
Mi primera misión: una tabla de multiplicar
Uno de los ejercicios consistió en mostrar la tabla de multiplicar del 5. Para comenzar, definí una variable llamada $numero y preparé un título junto con una lista para presentar las operaciones.
English
Hello, Hive community!
Today I want to share a different experience: a learning session in which I practiced programming with PHP. This time, the challenge was not about winning a match, but about understanding how to organize instructions and fix mistakes to complete several exercises.
During this practice, I worked with variables, loops, arrays, and conditionals. Although some concepts made me stop and review my code several times, finishing the exercises was very satisfying. Most importantly, I did not simply copy a solution: I kept writing, asking questions, and making corrections until I understood each part better.
My first mission: a multiplication table
One exercise involved displaying the multiplication table for 5. To begin, I defined a variable called $numero and prepared a heading along with a list to present the calculations.
Entendiendo las repeticiones
Para generar las operaciones utilicé un ciclo for, con un contador que comenzaba en 1 y llegaba hasta 12. Al principio escribí una multiplicación fija, cuando lo que necesitaba era utilizar $numero * $i. Corregir ese detalle me ayudó a comprender cómo cambiaba el cálculo en cada vuelta.
También había colocado el cierre de la lista dentro del ciclo. Al moverlo fuera, entendí mejor cuáles instrucciones debían repetirse y cuáles tenían que ejecutarse una sola vez.
Otro descubrimiento fue que podía mostrar una tabla diferente cambiando únicamente el valor inicial de $numero. No necesitaba modificar todas las operaciones, porque ya estaba utilizando esa variable en el cálculo y en los mensajes.
Una nueva misión: registrar estudiantes
Después trabajé en un ejercicio que pedía una lista de al menos cuatro estudiantes. Cada uno debía tener nombre, cédula y nota. Preparé el arreglo $estudiantes con los datos de Carlos, María, José y Ana.
Understanding repetition
To generate the calculations, I used a for loop with a counter that started at 1 and went up to 12. At first, I wrote a fixed multiplication when I actually needed to use $numero * $i. Correcting that detail helped me understand how the calculation changed with each iteration.
I had also placed the closing list tag inside the loop. Moving it outside helped me understand which instructions needed to repeat and which ones should run only once.
Another discovery was that I could display a different table simply by changing the initial value of $numero. I did not need to modify every calculation because I was already using that variable in both the calculation and the messages.
A new mission: recording students
Next, I worked on an exercise that required a list of at least four students. Each student needed a name, an identification number, and a grade. I created the $estudiantes array with information for Carlos, María, José, and Ana.
Claves, valores y pequeños errores
Con este ejercicio aprendí a distinguir entre las claves y sus valores. Por ejemplo, "nombre" era la clave que me permitía acceder al nombre guardado en cada registro.
Para recorrer la lista utilicé foreach. Al principio escribí mal esa palabra e intenté mostrar los nombres individualmente. Después comprendí que el ciclo se encargaba de repetir el mismo bloque para cada estudiante.
También practiqué la concatenación con el punto para unir los textos con los datos. Tuve errores con las comillas, los puntos y coma y hasta con un espacio adicional dentro de la clave "cedula". Fueron detalles pequeños, pero me enseñaron a revisar con más atención.
La condición para aprobar
Finalmente, incorporé un if y un else para mostrar si cada estudiante estaba aprobado o reprobado. Utilicé la escala de otro ejercicio: de 0 a 20, con 10 como nota mínima para aprobar.
Mi primer intento dejó la condición fuera del foreach. Al corregir su ubicación, comprendí que debía evaluar la nota dentro del recorrido para mostrar el estado de cada alumno.
Keys, values, and small mistakes
This exercise taught me to distinguish between keys and their values. For example, "nombre" was the key that allowed me to access the name stored in each record.
I used foreach to go through the list. At first, I misspelled that keyword and tried to display the names individually. Then I understood that the loop repeated the same block for each student.
I also practiced concatenation with the dot operator to join text with data. I made mistakes with quotation marks, semicolons, and even an extra space inside the "cedula" key. These were small details, but they taught me to review my work more carefully.
The condition for passing
Finally, I added an if and an else to show whether each student had passed or failed. I used the grading scale from another exercise: 0 to 20, with 10 as the minimum passing grade.
In my first attempt, I placed the condition outside the foreach loop. Correcting its position helped me understand that I needed to evaluate the grade inside the loop to display each student's status.
Un nivel más de aprendizaje
Recibí orientación paso a paso de un asistente de inteligencia artificial, pero fui escribiendo y ajustando mi propio código. Esa dinámica me permitió detenerme en cada error y entender qué necesitaba cambiar.
Me quedo con algo más valioso que los ejercicios terminados: una mejor comprensión de lo que estaba haciendo. Equivocarme no significó fracasar; fue parte del camino para aprender.
Esta práctica me recordó que avanzar también consiste en tener paciencia, prestar atención y volver a intentarlo. Hoy terminé con más claridad sobre las variables, los ciclos, los arreglos y las condiciones, y con la satisfacción de haber superado un nuevo reto.
¡Gracias por acompañarme en este pequeño avance dentro del mundo de la programación!
Another level of learning
I received step-by-step guidance from an AI assistant, but I wrote and adjusted my own code. This approach allowed me to pause at each mistake and understand what needed to change.
I am taking away something more valuable than completed exercises: a better understanding of what I was doing. Making mistakes did not mean failure; it was part of the learning process.
This practice reminded me that progress also requires patience, attention, and a willingness to try again. I finished with a clearer understanding of variables, loops, arrays, and conditionals, along with the satisfaction of overcoming a new challenge.
Thank you for joining me as I take this small step forward in the world of programming!
🏆 PANTALLA DE ESTADÍSTICAS / STATS SCREEN 🏆
| ⚔️ Rol / Role | 🛡️ Créditos / Credits |
|---|---|
| 👨💻 Autor y aprendiz / Author and learner | |
| 📸 Capturas / Screenshots | |
| 🎬 Producción / Production | |
| 🤖 Apoyo educativo y de redacción / Learning and writing assistance | Asistente de inteligencia artificial / AI assistant |
| 📚 Tema / Topic | Variables, ciclos, arreglos y condicionales en PHP / Variables, loops, arrays, and conditionals in PHP |
| 📅 Fecha / Date | 30/10/2026 |