Store number in variable , add 1 then repeat
<p>I'm work on PHP CMS , almost done of it</p>
<p>I use the Material Design Lite pop-up share menu, this required a html <code>id</code> property</p>
<p>as ex. if I post 2 articles and share menu has same id number then, when user press on a one of them the 2 will appear</p>
<p>so I need PHP code that do this for me, I don't need a very difficult script</p>
<hr />
<p>just need a script do this :</p>
<p>1 - make a variable contains id = 0</p>
<p>2 - add 1</p>
<p>3 - store the new value , id = 1</p>
<p>4 - repeat for every post</p>
<hr />
<h1>I tried this code :</h1>
<pre><code>&lt;?php
$id = 0;
echo $id += 1 ;
$id = $id ;
?&gt;
</code></pre>
<p>thanks in advance</p>