I put a lot of time into writing guides that make tech easier to understand.
If you found one useful, consider
buying me a coffee ☕ — it’s a small way to say thanks and it motivates me to keep sharing.
If you find that you have a string that contains commas and you need to remove them you can do the following. Let’s assume your string looks like this. Now let’s strip those ugly commas from our variable $myString using the str_replace() function. That’s it, enjoy!
Sometimes you may need to extract or create an archive file on your Linux server. The very first step in the process would be to identify the exact archive type by looking at the file extension. The most common archive types are zip (ending with .zip), tar (.tar), Tar+Gunzip (.tar.gz), Bzip (.bz2) and Rar (.rar).…
Grabbing the store code from Magento can be quite easy. The following code has always done the trick for me.
As a developer, sometimes it is essential to check if store code URLs are enabled. Store codes are well known for breaking extensions due to the URL format. If you need to check if store code URLs are enabled you could simply use the following.
Counting the elements in an array is quite simple. The $counter variable will now contain the value of 3. However, if your array contains empty values like the following array it would still return 3. This of course would be problematic in some situations of your script. In order to get the accurate count, we…