I am working on a project.In this i need to assign values in array with different location of code.first i used the $bd=array('1','420'); $bd=array('2','520'); etc.but when i echo $bd[1]; and echo $bd[2]; only last inserted value(520) is displayed.do you have any solution for it?
daniel36
-7
Light Poster
Recommended Answers
Jump to PostHi,
You may want to try using array_push() function.
example of usage...
<?php $bd= array('1','420'); array_push($bd,'2','520'); echo $bd[0].'<br/>'; echo $bd[2].'<br/>'; echo $bd[1].'<br/>'; echo $bd[3].'<br/>';
All 3 Replies
veedeoo
474
Junior Poster
Featured Poster
urtrivedi
276
Nearly a Posting Virtuoso
daniel36
-7
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.