Deep Tech Point
first stop in your tech adventure
Home / PHP
May 17, 2021 | PHP

Developers often need to escape special characters when they’re coding and PHP is not an exception neither. In PHP we’re familiar with an abundance of escaping functions and some of them deal with encoding HTML entities. In addition, MySQL is also particular when it comes to special characters and it has its own set of rules: they are usually covered with escaping functions such as addslashes. However, when we talk about storing JSON in MySQL the approach in escaping special characters is a bit different.

February 10, 2021 | PHP

The beauty of PHP is that you can do one thing in several different ways. And, yes, this is the case with PHP arrays too – they can be merged using the + array union operator or you could use the array_merge() function. However, there is a difference between array_merge and array + array, so let’s take a look at the functions we’re are dealing with.

February 4, 2021 | PHP

This article is going to focus on the comparison operator known as Equal Operator and presented as “==” or double equal sign, and the inbuilt strcmp() function. We are going to look at the differences and similarities between these two.

January 28, 2021 | PHP

You might get into a situation where you need to hook some PHP function. There are many reasons why you might need to do that. One of the most obvious cases is debugging. In PHP it is really easy to hook any function using override_function which overrides built-in functions. However, these simple “hacks” are practical only in conditions when you’re dealing with your own code or some relatively simple code you can change with ease.

In a more complex situation, like if you need to hook the PHP mail function without messing with some third-party source code you need to do it a bit differently.

January 18, 2021 | PHP

You could come into a situation where you are dealing with HTML special characters in some text. Ordinary users might not even notice these special characters exist because when they take a peek at a text in a browser these characters look exactly like normal characters do. However, if you – an advanced user – take a look into the page source, you’ll notice some very unusual presentations, (&amp; for &, &quot; for “, &lt; for <, &gt for > and so on). So, the question is – how do you convert this mumbo jumbo to normal characters?

January 9, 2021 | PHP

As you probably know it’s possible to install multiple versions of PHP on one server. For web servers, simply define which PHP version you want to use in your server’s configuration file. But how to do it for PHP cli?

January 2, 2021 | PHP

PHP can sometimes be confusing when it shouldn’t be. One area of confusion is the issue with “duplicate” built-in functions. I’m always inclined to think that language makers probably had a good reason to make duplicates and most of the time that is a good assumption.
But is it always true? Let’s see an example of echo end print functions. Technically speaking neither echo nor print are functions but language constructs so you don’t need to use parentheses with its arguments.

<?php
echo "get ready: ", 1, 2, 3, " go";  // outputs get ready: 123 go
print "get ready: 123 go";  // print can't handle multiple arguments like echo
?>