How to pass the values of an array to another from bottom of the page to the top?

Question

I know this is very simple and easy, but I am new to wordpress, php, and js.

$classes = array();
array_push($classes, $match);
foreach($classes as $names => $text ) {

preg_match('/<strong class="'.$text.'">(.*?)</strong>/s', $sample, $match);
preg_match('/<p class="'.$text.'">(.*?)</p>/s', $sample, $match);

echo $match[1];

I want to get the values of $match, which which is declared at the bottom and use it as the values of $classes, which is declared at the top. Because I want the $text variable work at the bottom. I hope I am clear enough.

  • In another word, I want to get the number of times $match[1] will echo and use it as the length of $classes.
0
Ashur 11 months 0 Answers 61 views 0

Leave an answer