--- /dev/null
+#!/bin/bash
+cd "$(dirname "$0")" || exit 1;
+IFS=$'\n'
+for i in \
+ array \
+ "calendar '' 1"\
+ "date '' 2"\
+ directory \
+ "error '' 2"\
+ exception \
+ "filesystem '' 2"\
+ "filter '' 2"\
+ "ftp '' 1"\
+ "json '' 1"\
+ keywords \
+ "libxml '' 1"\
+ "mail '' 2"\
+ "math '' 1"\
+ "misc '' 2"\
+ mysqli \
+ network \
+ "output '' 2"\
+ "regex '' 2"\
+ simplexml \
+ stream \
+ string \
+ variable_handling \
+ "xml '' 1"\
+ zip \
+; do
+
+ opt=${i#*" "}
+ [ "$opt" == "$i" ] && opt=""
+ i=${i%%" "*}
+ [ -n "$1" -a "$i" != "$1" ] && continue
+
+ echo "- $i $opt" 1>&2
+ eval ./w3schools.sh /php/php_ref_${i}.asp $opt | sed "s/^/$i\t/"
+done
+#./w3schools.sh /php/php_ref_timezones.asp | sed 's/^/timezones\t/'
--- /dev/null
+DROP TABLE IF EXISTS php_function;
+CREATE TABLE IF NOT EXISTS php_function (
+ cat varchar(30),
+ name varchar(100),
+ description varchar(500),
+ link varchar(200),
+ PRIMARY KEY(cat,name)
+);
+-- COPY php_function FROM '/home/nico/tmp/csv' WITH (format 'text', NULL '');
path=${1:?Usage: $0 /path/ for url https://www.w3schools.com}
cut="$2"
+num="$3"
+
url="https://www.w3schools.com$path"
preff="$(echo "$url"|sed -E 's,[^/]+\.[^/]+$,,')"
#exec echo $preff
+#exec echo "<$cut>"
http_get "$url" | \
xmllint --format --html --xpath '/html/body//div[@id="main"]//table' - 2>/dev/null | \
grep -Ev '<th' | \
-html2csv --href2txt | \
+html2csv $(test -z "$num" || echo "--num $num ")--href2txt | \
sed -E \
-e "s,\[href=([^]]+),[href=$preff\1,g" \
-e "s,(\\\\),\1\1," \