Advertisement
OldManRiver

Image Display Processing

Jan 1st, 2018
112
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $dis_ray = array();
  3. $myray = array();
  4. $tabray = array();
  5. $flt_str = '1 html php html~ php~';
  6. $dir = '/home/myimagefiles/';
  7. $myray = array_values(array_filter(scandir($dir), function($file) {
  8. return !is_dir($file);
  9. }));
  10. $elm_cnt = count ( $myray );
  11. $row_cnt = round ( $elm_cnt/3 );
  12. $itm_cnt = 0;
  13. echo "EC=> $elm_cnt RC=> $row_cnt IC=> $itm_cnt <br>";
  14. foreach ( $myray as $file ) {
  15. $pth_prt = pathinfo ( $file );
  16. $fil_ext = $pth_prt [ 'extension' ];
  17. $fil_dir = $pth_prt [ 'dirname' ];
  18. $ext_pos = strpos ( $flt_str, $fil_ext );
  19. echo "F=> $file FE=> $fil_ext EP=> $ext_pos FD=> $fil_dir <br>";
  20. if ( $ext_pos > 0 ) { continue; }
  21. $dis_ray = $fil_dir.$file;
  22. }
  23. ?>
  24.  
  25. This is erroring, not an error message, but this garbage:
  26.  
  27. ******************************************************************************************
  28.  
  29. $elm_cnt RC=> $row_cnt IC=> $itm_cnt
  30. "; foreach ( $myray as $file ) { $pth_prt = pathinfo ( $file ); $fil_ext = $pth_prt [ 'extension' ]; $fil_dir = $pth_prt [ 'dirname' ]; $ext_pos = strpos ( $flt_str, $fil_ext ); echo "F=> $file FE=> $fil_ext EP=> $ext_pos FD=> $fil_dir
  31. "; if ( $ext_pos > 0 ) { continue; } $dis_ray = $fil_dir.$file; } /* for ($i = 0; $i <= $row_cnt; $i++) { $dis_itm = $dis_ray[$itm_cnt]; $row_out = "\t\t\n\t\t\t
  32.  
  33. ******************************************************************************************
  34.  
  35. Stared at this for hours, but not making the connect with what is wrong. Guessing syntax, but not seeing it.
  36.  
  37. Also I copied lines #7-9 from a HOWTO webpage, so may be an error in that code, which I'm not seeing.
  38.  
  39. ******************************************************************************************
  40. This is the View Source results. No difference except for "red" color down to line #13 ending at the '>' in the echo statement.
  41.  
  42. <?php
  43. $dis_ray = array();
  44. $myray = array();
  45. $tabray = array();
  46. $flt_str = '1 html php html~ php~';
  47. $dir = '/home/myfiles/PIX/';
  48. $myray = array_values(array_filter(scandir($dir), function($file) {
  49. return !is_dir($file);
  50. }));
  51. $elm_cnt = count ( $myray );
  52. $row_cnt = round ( $elm_cnt/3 );
  53. $itm_cnt = 0;
  54. echo "EC=> $elm_cnt RC=> $row_cnt IC=> $itm_cnt <br>";
  55. foreach ( $myray as $file ) {
  56. $pth_prt = pathinfo ( $file );
  57. $fil_ext = $pth_prt [ 'extension' ];
  58. $fil_dir = $pth_prt [ 'dirname' ];
  59. $ext_pos = strpos ( $flt_str, $fil_ext );
  60. echo "F=> $file FE=> $fil_ext EP=> $ext_pos FD=> $fil_dir <br>";
  61. if ( $ext_pos > 0 ) { continue; }
  62. $dis_ray = $fil_dir.$file;
  63. }
  64. ?>
  65.  
  66. ******************************************************************************************
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement