i have page name properties.php which contain list of properties listing from array(static listing without database), when user click on view-details achor tag
details.php contains all details of the file which is ok works fine but what i want is that i want to insert content in details.php like details-locations.php location will change according but if insert location from array into details.php like:
Well, look at the coloring that the forum has applied to your attempt vs your first bit of code. Note where it goes wrong. That will probably tell you what you need to fix…
You could have MANY locations which would then require multiple detailslocation.php pages.
If your list of properties can be sorted by the location, then you could make a form to control what location is shown on the page. Think of it like a pre-filter for your list.
<?= Only if short tags are enabled.
Also as you are already using php to loop through your array and define your variable, why jump back into html? Just stay in php echo the link without all the in-and-out or back and forth.