Skip to content
Advertisement

Passing variables to the same include that appears multiple times

I’m trying to pass variables in an include that appears on a page multiple times. While the following sample may technically work, I’m sure there is a much better way of doing this. Any help would be appreciated.

index.php

JavaScript

_user-card.php

JavaScript

Advertisement

Answer

You can create data that you can use over and over again by using the following function.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement