How to manually put esp32 into AP mode

Hello everyone, we all know that when the esp32 device has no network configured or is not connected to the network, it will enter AP mode so that users can configure the WIFI it can connect to; but when the esp32 is already connected to wifi, is there any way to make the esp32 enter AP mode again? I do this to achieve wifi switching, for example, I want to switch a network environment for the device

Looks like you can do both AP and station mode simultaneously.

This was discussed in a recent thread;