Let $G$ be a non-abelian finite $p$-group, do we have $Z(G) \leq \Phi(G)$ in general?

Let $$G$$ be a non-abelian finite $$p$$-group. I wonder if $$Z(G) \leq \Phi(G)$$, where $$\Phi(G)$$ is the Frattini subgroup of $$G$$? I'd known that it is true for non-abelian groups of order $$p^3$$ but I doubt it is true in general or not.

I understand that it isn't true in general. As showed below it isn't true for some group of order $$p^4$$.

• @Yasmin: Your edit does not address the original problem: why did you think it was true, or why did you want to prove it? As to what you write now, you “ask” whether it is true, and then you say you “understand” it isn’t. That makes the question self-contradictory. – Arturo Magidin Jan 4 at 6:16
• @ArturoMagidin Would you please suggest how to edit it in a right way? – Yasmin Jan 4 at 6:37
• @Yasmin: Add context. Add why you were interested in this; why you thought it might be true. Do not falsify the record by writing nonsense after the fact when it turned out that what you wanted to prove is actually false. That would be a good place to start, instead of asking people to do your work for you, again. – Arturo Magidin Jan 4 at 7:24
• The general point is that if you do not know whether something is true or not, then you should not say "help me prove this", you should say "help me decide whether this is true". Otherwise people might waste time trying to prove something that isn't true. You should also say where the problem comes from: is it a homework exercise, is it a problem from a book, is it your own problem? (Occasionally problems from books are wrong, and of course in that case everybody would be confused!) – Derek Holt Jan 4 at 8:49
• I have voted to reopen, because the question itself has some interest and it has been correctly answered. – Derek Holt Jan 4 at 8:54

Let $$H$$ be the nonabelian group of order $$p^3$$ and exponent $$p$$. Let $$C_p$$ be a cyclic group of order $$p$$. Let $$G=H\times C_p$$. Then $$Z(G)$$ is a direct product of two copies of $$C_p$$, one contained in $$H$$, the other the second direct factor of $$G$$.
However, $$H$$ is maximal in $$G$$, and so $$\Phi(G)\subseteq H$$. Thus, $$Z(G)$$ is not contained in $$\Phi(G)$$.
More generally, given any nonabelian $$p$$-group $$K$$, letting $$G=K\times C_p$$ gives you a group with center $$Z(G) = Z(K)\times C_p$$, and with $$K$$ maximal and hence $$\Phi(G)\subseteq K$$, hence a counterexample to the assertion to $$Z(G)\subseteq \Phi(G)$$.