Skip to content

Tag: php

php-ffi: Return type const char* is a string

Why is the result of const char * a string and char * an object „byte-array“? A simple example: returns Removing const from the definition returns: Background A function of a dynamically linked external C library returns binary data which include NULL-bytes. When const is in the definition of the header file …

Laravel not creating projects in Code-Folder

I have a fresh new installation of homestead an wanted to initiate my first Laravel project. It seems, that is always creating the Project not in the Code folder, but in root. Maybe this is the reason, why my mapping to my windows folder isn’t working, too. This is my Homestead.yaml I tried it with 3 pr…

Laravel get union between two objects

I have the following to get all organizations the logged in user owns and to get all organizations the logged in user is member of Given that I want an object with the union of both, I tested to run then I only get one organization If I run then I got While the result is correct in the sense

Regex with avoidation of markdown

Pattern is : /(?:https?://)?(?:[^.]+.)?momento360.com/e/(.*)?/i This regex pattern returns the remaining part of the URL after the website. But now I want to ignore the string that is in [click here](…) Markdown Answer You can use See the regex demo. Here, [click here](http[^()]*)(*SKIP)(*F) – mat…

Crontab via exec() not working with PHP 7.4 / Deb 10

Bit of a hard one to debug as I’m working with both a new version of PHP and a new OS on a new server. I have a cron management system in PHP that allows me too add / remove or enable / disable cronjobs. On another current Deb 8 server with PHP 7.2 it works flawlessly using the following

Trigger Stripe SCA redirection for authentication

I have this stripe file StripePayment.php and i am charging the card like this This code is able to charge cards but can’t charge cards where 3D/SCA is required i.e European cards. My question, is there a way i can request stripe to redirect the user to the card issuing bank for authentication so that t…