#search Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
PHP Highlight Search Term in Text
Wrap every case-insensitive occurrence of a search term in <mark> tags for quick visual highlighting in search results. Properly escapes HTML so user input cannot inject markup.
PHP Find Files Modified in Last N Days
List every file under a directory that was modified within the last N days. Useful for incremental backups or detecting stale entries.
Bash Check If Array Contains Element
A pure-bash membership test using `=~` or by iterating. Both are useful — pick by readability vs. speed.
HTML Search Form with Accessible Label
A search input usually has a visible-only icon — but screen readers need a real label. Pair a visually-hidden `<label>` with the icon, OR use `aria-label` on the input.
SQL Full-Text Search (PostgreSQL tsvector)
`tsvector` + `tsquery` is built-in full-text search — stemming, ranking, multilingual. For most apps this beats reaching for Elasticsearch right away.