I've been learning PHP for about two months, after previously spending time with JavaScript. I can still read JavaScript and understand what it does, but when I try to write it from scratch, I forget even basic syntax. Is this a normal part of learning, and how can I get better at retaining it?
3 Answers
Try not to treat memorizing every keyword or API as the main goal. Programming is more about recognizing patterns, breaking down problems, and knowing which tools can help. Looking up syntax is normal; understanding the solution you want to express is more important.
Yes, that's completely normal. Skills fade when you don't use them, including programming syntax. The good news is that previously learned material usually comes back much faster once you start practicing that language again.
Regular practice helps a lot, even if it is only a small project or a few lines of code each day. Write something, debug it, and look up whatever you forget. Repeated use will make the common parts stick, while the less-used details can always be checked when needed.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically