Here’s a style file for php.ini when using nano. For this particular situation it is Ubuntu 22.04.
sudo nano/usr/share/nano/phpini.nanorc
Copy/paste this into it:
## Syntax highlighting for PHP.ini.
syntax "ini" "\.ini(\.old|~)?$"
magic "PHP ini"
comment "//"
# Trailing whitespace.
color green "[[:space:]]+$"
# values
color brightred "=.*$"
# equal sign
color green "="
# numbers
color brightblue "-?[0-9\.]+\s*($|;)"
# ON/OFF
color brightmagenta "ON|OFF|On|Off|on|off\s*($|;)"
# sections
color brightcyan "^\s*\[.*\]"
# keys
color cyan "^\s*[a-zA-Z0-9_\.]+"
# comments
color brightyellow ";.*$"
ctrl+X to save/exit
Adjust colors to suit your tastes.