Stimulus-responsive liquid foams have gained much attention for use in various industrial applications. However, it remains challenging to construct such systems with integrated functionality of easy preparation, high stability, high foaming ability, and rapid on-demand degradation. Herein, by combining the Hofmeister effect and nanotechnology, a promising ultrastable and photoresponsive liquid foam was prepared that had a lifetime of several months and could be destroyed on demand in a few minutes. Specifically, the system was prepared by simply mixing a gelatine solution containing black phosphorus nanosheets (BPNs) and kosmotropic anions in the Hofmeister series with air in one step using only two syringes, and there were no chemical modifications or crosslinking agents required. The kosmotropic anions induced stronger hydrophobic interactions, bundling within molecular chains, and blockage of foam drainage channels, which significantly improved the foaming ability and the lifetime and mechanical properties of the foam. Moreover, rational structure design realized a promising on-demand degradation mechanism via a cascading “light trigger–heat generation–Marangoni flow generation” process occurring on the bubble surfaces. On this basis, the BPNs converted light into thermal energy, which induced Marangoni flow driven by surface tension gradients along the gas‒liquid interfaces, and the bubble film ruptured within seconds upon light illumination. The designed stimulus‒response systems combined stable, fast and repeatable processes without sacrificing the foaming abilities, thus providing a general way to control the stabilities of foams, bubbles and films.