How to use mediawiki API to create a table for a wiki page in PHP

╄→гoц情女王★ 提交于 2019-12-25 03:16:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!