Jump to content

Search the Community

Showing results for tags 'css json php html output'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hello All I am desparately wanting to stylize my output - here is my code: <?php[attachment=1368:apiToHtmlinJoomlaArticle2.PNG] $url = "http://184.173.18.228/api/profile/1000/0/Adam.Adams"; $json = file_get_contents($url, 0, null, null); $json_output = json_decode($json); echo '<pre>'; //print_r("query results:"); //print_r($json_output); '</pre>'; //$obj = array('section', 'fname', 'lname'); //var_dump($obj) ?> <?php function createTable(&$node, &$output, $key = NULL, $indent = 0) { if ($indent > 0) { $output .= "<tr>\n"; $output .= "<td><strong>" . $key . "</strong></td>"; } else { //$output .= '<tr><td>Top Level</td>'; } if (is_object($node) || is_array($node)) { $node = (array)$node; $output .= "</tr>\n"; $count = 0; foreach ($node as $k => $v) { createTable($node[$k], $output, $k, $indent + 1); } } else { $output .= "<td>" . ($node === TRUE ? 1 : $node === FALSE ? 0 : $node) . "</td>"; $output .= "</tr>\n"; } } function outputTable($object) { echo "<table border='0'>"; $output = ""; createTable($object, $output); echo $output; echo "</table>"; } outputTable($json_output); ?> not quite sure how - Im so used to ( at least) inline css - attached is the output that I was even able to insert into a Joomla article Thanks Rob
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.