Note that there are some explanatory texts on larger screens.

plurals
  1. POTournament Generator PHP
    primarykey
    data
    text
    <p>I found this package and I am trying to run the example and the show the bracket.</p> <p>But it outputs some weird characters:</p> <pre><code>�PNG IHDR�Ht�4PLTE���U��~�IDATx����o�V��GIW&amp;q�*�=ު`B�&amp;��?�?!R*Mv� </code></pre> <p>You get the point.</p> <p>I am thinking that it's because:</p> <pre><code>// If GD-lib is installed, the below code will draw the bracket of the knock-out tournament. if ($GDLIB_INSTALLED) { $im = $KO-&gt;getImage("Tournament name here"); header('Content-type: image/png'); imagepng($im); imagedestroy($im); } </code></pre> <p>But I dont know how to fix it....</p> <p>Thanks, Ara</p> <p>EDIT:</p> <p>So I changed the code a bit after what gat said.</p> <p>In my controller, I got: public function getTest(){</p> <pre><code> // Depending on whether or not GD-lib is installed this example file will output differently. $GDLIB_INSTALLED = (function_exists("gd_info")) ? true : false; // Lets create a knock-out tournament between some of our dear physicists. $competitors = array( 'Paul A.M. Dirac', 'Hans Christian Oersted', 'Murray Gell-Mann', 'Marie Curie', 'Neils Bohr', 'Richard P. Feynman', 'Max Planck'); // Create initial tournament bracket. $KO = new TournamentGeneratorGD($competitors); $KO-&gt;setResByMatch(1, 1, 4, 0); if($GDLIB_INSTALLED){ $im = $KO-&gt;getImage("Tournament name here"); return View::make('test_img') -&gt;with('im', $im); } else return View::make('home'); } </code></pre> <p>And in my test_img.php page, I got this:</p> <pre><code>&lt;?php header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?&gt; </code></pre> <p>It doesnt work anyway..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload