CSS not updating in PHP page

 


    If you are working with PHP you may have faced a problem that whenever the CSS is being updated the new styles are not shown in the PHP page. This happens due to some caching problems. In this situation you have to hard reload the CSS each time page is refreshed. Normally, you have already included the CSS like this: 

<link rel="stylesheet" href="style.css" />

    But to hard reload the CSS and make the styles work every time you update the CSS file, you have to include the PHP code after CSS file name with ?v= <?php echo date('his'); ?> . So the final structure will be like: 

<link rel="stylesheet" href="style.css?v=<?php echo date('his'); ?>" />

Hope, you understand the solution. If you have any opinion, doubt or suggestion make a comment below. Also mention your country name in the comments, I am curious!! Ok, have a good day , Byee..

Imon Raj

Software, Web & Android Developer

My Skills:

Comments

  1. Great article by the great author, it is very massive and informative but still preaches the way to sounds like that it has some beautiful thoughts described so I really appreciate this article. Best webdesigner agentur berlin service provider.

    ReplyDelete

Post a Comment

Popular posts from this blog

Which one is better ? GeeksForGeeks or Leetcode ? How many questions to solve ?

Random Gradient Generator With CSS and Javascript