Blog | falk-m.de
This blog is not for you, not only.
Like other developers, I read articles, test new features, analyze code from others and so on.
Also, I have some interesting code snippets used in projects, if I need them, I always search in old projects.
This blog is my central place now, to collect interesting code snippets, features, etc.
anonymous classes in php
from falk-m.de
· 2024-04-02
PHP
Since PHP Version 5.3., PHP supports anonymous functions and classes.
Here is an example for an anonymous function:
$add = function(int $a, int $b){
return $a + $b;
}
If you want to use a varia...
htaccess best practices
from falk-m.de
· 2024-02-16
PHPSECURITY
SEO and performance
set expiration header
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 week"
ExpiresByType text/html "access plus 600 seconds"
Expir...
Become a PHP professional developer | Part 1
from falk-m.de
· 2024-02-16
PHP
I want to ride a series to become a professional skill set in web development with PHP.
First, I check online applications searching a senior PHP developers.
Here is a list of required skills.
requ...
Post messages to Slack Channel
from falk-m.de
· 2024-02-08
PHP
find the channel id
There are many ways to find the channel id.
The simplest is, to use the Slack browser application and copy the channel id from the URL after you enter the channel.
The URL looks...
Server side events with php
from falk-m.de
· 2024-02-06
PHPJS
There are different ways for near real-time browser updates by a server message.
With a PHP website on the server side, you are very restricted, because in normal case you can't run a web socket pr...
Server side event tracking with matomo
from falk-m.de
· 2024-01-31
PHP
if you want to track events, like a click, an error or a login try,
you can do this serverside without cookies, with matomo.
First download and install matomo.
Then you need an authentification tok...
Rewrite to public folder
from falk-m.de
· 2024-01-30
PHP
If you install the symphony framework or a shopware webshop for example, you have to change the routing on our web server, because the applications require, that the webroot be pointed to the '/pub...
encrypt emails with s/mime on PHP and send with PHPMailer over smtp
from falk-m.de
· 2024-01-25
PHP
php mail can sign messages but not encrypt them.
For a project, I have to encrypt the mail Body with php.
First, I have to receive the public key from the recipient.
In my case, I test it with the ...
Mongo Light
from falk-m.de
· 2023-12-10
PHP
There is a great CRM System EspoCrm.
In Espo, you can administrate the object types, their properties and their relations in the user interface.
This schema is then automatically created in a MySQL...
URL safe encoding
from falk-m.de
· 2023-12-09
PHP
protected function urlSafeBase64Decode(string $data)
{
$value = \base64_decode(\strtr($data, '-_', '+/'));
$data = \json_decode($value);
if (\JSON_ERROR_NONE !== \json_...