The following two theorems are classical characterisations of the absolute HEP.
Theorem (Strøm) A closed subspace inclusion $j:A\hookrightarrow X$ is a cofibration if and only if there exists a map $\varphi:X\rightarrow I$, and a homotopy $H:X\times I\rightarrow X$, satisfying
- $A=\varphi^{-1}(0)$,
- $H_0=id_X$
- $H_t|_A=id_A$ for all $t\in I$
- $H(x,t)\in A$ whenever $t>\varphi(x)$. $\quad\blacksquare$
Theorem An inclusion $A\subseteq X$ is a cofibration if and only if $A\times I\cup X\times 0$ is a retract of $X\times I$. $\quad\blacksquare$
Putting these together allows for a new characterisation (which is also fairly well-known).
Theorem Let $X$ be a space and $A\subseteq X$ a closed subset. Then the inclusion $j:A\subseteq X$ is a cofibration if and only if $A$ has a neighbourhood $U\subseteq X$ for which there is a map $\varphi:X\rightarrow I$ and a homotopy $H:U\times I\rightarrow X$ such that
- $A=\varphi^{-1}(0)\subseteq\varphi^{-1}[0,1)\subseteq U$.
- $H_0(x)=x$ for all $x\in U$
- $H_t(a)=a$ for all $a\in A$, $t\in I$
- $H_1(x)\in A$ for all $x\in U$.
Proof For necessity assume $j:A\hookrightarrow X$ is a cofibration and fix a pair $(\varphi,H)$ as in Strøm's Theorem. Putting $U=\varphi^{-1}[0,1)$, the triplet $(U,\varphi,H)$ satisfies the requirements of the statement.
For sufficiency we define a retraction $r:X\times I\rightarrow X\times0\cup A\times I$ by
$$ r(x,t)=\begin{cases}
(x,t)&x\in\varphi^{-1}(0)\\
(H(x,1),t-2\varphi(x))&x\in\varphi^{-1}(0,1/2]\;\text{and}\;2\varphi(x)\leq t\leq1\\
(H(x,t/2\varphi(x)),0)&x\in\varphi^{-1}(0,1/2]\;\text{and}\;t\leq2\varphi(x)\\
(H(x,2(1-\varphi(x))t),0)&x\in \varphi^{-1}[1/2,1)\\
(x,0)&x\in \varphi^{-1}(1).
\end{cases}
$$
$\blacksquare$
The following is the desired application. Recall that a space is perfectly normal if it is normal and each of its closed subsets if $G_\delta$. Equivalently, $X$ is perfectly normal if for any pair of disjoint closed subsets $A,B\subseteq X$ there is a continuous function $\varphi:X\rightarrow I$ such that $A=\varphi^{-1}(0)$ and $B=\varphi^{-1}(1)$. Clearly every metric space is perfectly normal. Moreover, one can show that perfect normality is preserved by adjunction spaces and sequential colimits, so every CW complex is perfectly normal.
Corrollary Let $X$ be a perfectly normal space and $A\subseteq X$ a closed subset. Assume that $U\subseteq X$ is a neighbourhood of $A$ and the inclusion $A\subseteq U$ is a cofibration. Then $A\subseteq X$ is a cofibration.
Proof Since $A\subseteq U$ is a cofibration, by the previous theorem there is a neighbourhood $V\subseteq U$ of $A$ and a homotopy $H:V\times I\rightarrow U$ satisfying the listed properties.
On the other hand, since $X$ is perfectly normal, $A$ is closed in $X$, and $V$ is a neighbourhood of $A$ in $X$, there is a map $\varphi:X\rightarrow I$ such that $A=\varphi^{-1}(0)\subseteq\varphi^{-1}[0,1)\subseteq V$. The triplet $(V,\varphi,H)$ satisfies the requirements of the theorem, so $A\subseteq X$ is a cofibration. $\blacksquare$