php - find a string in html code that is stored in an array -


i've been trying figure out past few hours:

i have filesystemiterator that's grabbing pages in pages folder.

$pages = new filesystemiterator("pages", filesystemiterator::skip_dots); 

i store page data array

    foreach ($pages $page){     $getme = array();     $getme = file_get_contents($page);     array_push($display, $getme);        } 

it grabbing pages , storing html data in $display.

now problem

i trying class name .page in array able sort how information output in order class name, ex; page0, page1, page2. here code:

    //find .page in html page for($i = 0; $i <= count($display)-1; $i++):      $page = 'page' . $i;      foreach ($display $test):             //if (in_array_r($page, $test)):                       //echo $test;             //endif;       endforeach; endfor; 

in_array_r nice function found here (thanks jwueller!) able use $haystack array (in_array( $needle, $array) doesnt work)

someone me


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -