问题
I intend to use MediaWiki API to create a table for a wiki page. In MediaWiki, the syntax for creating a table should be like the following:
{|class="wikitable sortable"
!'''Full Name'''||'''Short Name'''
|-
|MediaWiki||MW
|}
When I called MediaWiki API, I stored the contents which I want to add to the page in a string:
$content = "{|class='wikitable sortable'<br>!'''Full Name'''||'''Short Name'''<br>|-<br>|MediaWiki||MW|}";
I intended to used "br" to make line breaks, but failed to create a table. Without line breaks, a table can't be showed either. How can I make line breaks before I call MediaWiki API?
来源:https://stackoverflow.com/questions/19940674/how-to-use-mediawiki-api-to-create-a-table-for-a-wiki-page-in-php