You can try this code
$d = dir(".");
echo "<ul>";
while (false !== ($entry = $d->read()))
{
if (is_dir($entry) && ($entry != '.') && ($entry != '..'))
echo "<li><a href='{$entry}'>{$entry}</a></li>";
}
echo "</ul>";
$d->close();
a thoughtful use of digital
You can try this code
$d = dir(".");
echo "<ul>";
while (false !== ($entry = $d->read()))
{
if (is_dir($entry) && ($entry != '.') && ($entry != '..'))
echo "<li><a href='{$entry}'>{$entry}</a></li>";
}
echo "</ul>";
$d->close();
In a table (chronological) if you have dates stored as text you could have problem to order your data.
I.g. you coud have this (wrong) order:
-13.600.000.000, -13.700.000.000,-4.600.000.000
To get the right order you can try with
cast(data as int)
Where “data” is the column of data (as the above values). In this way you will get the correct order:
-13.700.000.000, -13.600.000.000,-4.600.000.000
If your server cannot establish a connection with a webpage, you can check where is the problem with a code like the following:
<?php
$link = mysqli_connect("localhost", "user", "psw", "dbname");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
if (!mysqli_query($link, "SET a=1")) {
printf("Error message: %s\n", mysqli_error($link));
}
/* close connection */
mysqli_close($link);
?>
If you want to get a php variable if another is not present, without using the if ... then syntax, you can use this code
$some_variable = $optimal_variable ?? $alternative_variable;
IFTT is a good app, but with a free plan you can connect only one wordpress category to one facebook page.
There are many plugins and many web services, such as Zapier, or Activepieces, that can connect wordpress with a facebook page, but if you have a free wordpress plan (with an address like yourdomain.wordpress.com) you can install plugins only upgrading your plan.
The url should have this pattern:
https://your-wordpress-blog/category/your-category/
Many Linux distros are leaving xorg (x11) for Wayland, as display server protocol. Unfortunately not all the applications are ready for Wayland.
In particular Autokey, a very useful application to expand text and automatize typing operations, is not (yet) compatible with Wayland.
A quite good replacement of Autokey is Espanso. But there are also some limitations:
However, as long as the main typing operations are in LibreWriter, or Kate, you can use that applications possibilities to expand text.
in LibreWriter there are at least two possibilities (to expand an abbreviation):
In Kate you can use snippets to create something similar to Autokey.
I.g. to create a snippet to wrap selected text with the tag <h1>, you can add this code as snippet code:
${rangeCommand("<h1>%%1</h1>", "title")}
Choose the title as you prefer (obviously without spaces), and a key combination, i.g. ctrl+1.
Don’t forget to add, in the javascript section (the tab scripts) this code
function rangeCommand(command, def) {
if (view.selectedText().length > 0) {
return command.replace("%%1", view.selectedText());
} else {
return command.replace("%%1", def);
}
}
In this way, you will be able to add a title <h1> to your selected text.
You can find it i.g. in your home folder, as hidden file with a name such as .hunspell_it_IT.
If you have many PC you can share it between your devices.
This can be useful to build a multilingual website. The code is very simple. Suppose to have a variable lang of the body of you pages. Something like this:
<body lang="<?php if(empty($lang)) {echo "it";} else {echo"$lang";} ?>">
And suppose that you want set the lang (language) of the target page from a link in a starting page.
You can use a code like the following
In the starting (aaa.1.php):
<p><a href="aaa.2.php?setlang=en">eng</a><br /><a href="aaa.2.php?setlang=it">ita</a><br /><a href="aaa.2.php?setlang=es">esp</a></p>
In the target page (aaa.2.php):
<?php
$lang = $_GET['setlang'];
?>
<html>
<body lang="<?php if(empty($lang)) {echo "it";} else {echo"$lang";} ?>">
<p>your content here</p>
To find only a single digit (such as “1”, or “2”) and replace (only) it, you have to add a plus after \d.
Something like:
(\d+)
(to find it) and
\1
to replace it.
For example you have to add a new element to these lines
1 some first text
3 some other text
8 other text
You can use this regex
find: (\d+) replace: \n\1
as a result you will get
1 some first text
3 some other text
8 other text