Created
October 23, 2012 13:16
-
-
Save ziyahan/3938672 to your computer and use it in GitHub Desktop.
Veritabanından Dönen Sonuç Kümesini HTML Tabloya Dönüştürmek (PHP).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function html_table_returner($arr,$shows,$event="",$elementid=0) | |
{ | |
$shows=@explode(" ", $shows); | |
$json2="<table id='rtntbl' border='1'>"; | |
for($i=0;$i<=count($arr)-1;$i++) | |
{ | |
$json2.="<tr>"; | |
foreach($arr[$i] as $key=>$value) | |
{ | |
$json2.="<td "; | |
if(@in_array($key, $shows)) | |
{ | |
if($event) | |
{ | |
$json2.=" onclick='$event(this,$elementid)' "; | |
} | |
} | |
else | |
$json2.="style='display: none;'"; | |
$json2.=" class='$key'"; | |
$json2.=">$value</td>"; | |
} | |
$json2.="</tr>"; | |
} | |
$json2.="</table>"; | |
return $json2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment