This is quite confusing but as soon as you see the logic, it would make sense. Say you have this code: 1<?php 23$my_var= 'title'; 4$$my_var = 'PHP variable variables'; // $my_var has a value of 'title'. So the 2nd '$' makes it $title 5echo $title; // ...so, YOU see now where you will …
Read MoreBasic regex operator is =~ with basic syntax 1[[ "string" =~ pattern ]] NOTE pattern is not quoted, only the string. Very basic example when checking if a variable has either values 'running' or 'exited': 1status='running' ## change to 'exited' and '' to see it works 2if [[ …
Read MoreSometimes, you would like to know what your input credentials in browser. Do the following via Google Chrome Developer Tools: 1Chrome DevTools > Network > Fetch/XHR > login > Payload where login refers to something like https://api.myproject.local/v1/login
Read MoreThere's what is called a "Data Structure" or DS package available in packagist. Install 1~$ cd /an/isolated/directory 2~$ composer require php-ds/php-ds 3~$ composer install Try this code: 1<?php 2require __DIR__ . '/vendor/autoload.php'; 345$stack = new \Ds\Stack(); 6//$stack = new Stack(); …
Read MoreIf you ever need to serve your current directory via http for some reason, this is a quick command in python3: 1~$ python3 -m http.server 8000 Then access http://localhost:8000
Read MoreAs of php7.4, php arrow function was added as a more concise syntax for anonymous functions. Basic syntax: 1fn (arguments) => expression; Is functionally equivalent to the following anonymous function: 1function(arguments) { return expression; } Unlike anonymous functions, arrow functions can automatically access …
Read MoreHere is a curated links of sites that are I think are useful as I learn or relearn Web Development further. Incomplete of course but there's always the internet. Will add any that are worthy to be linked here. For now, this would suffice. If you think there are links worthy to be added here, let me know in the comment …
Read MoreHere is a curated links of sites that are I think are useful as I learn or relearn Perl further. Incomplete of course but there's always the internet. Will add any that are worthy to be linked here. For now, this would suffice. If you think there are links worthy to be added here, let me know in the comment below. …
Read MoreHere is a curated links of sites that are I think are useful as I learn or relearn Javacript further. Incomplete of course but there's always the internet. Will add any that are worthy to be linked here. For now, this would suffice. If you think there are links worthy to be added here, let me know in the comment below. …
Read More