Extension talk:PhpTags Functions
Add topicThis page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
strange results with str_word_count
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
{{PAGENAME}}<br /> {{#phptag:echo str_word_count("{{PAGENAME}}");}}
sometimes it gives strange results:
ÄastĂĄ prochĂĄzka
3
ĹĄumĂcĂ les
3
(The page name has two words but the function gives out 3?) Auvajs (talk) 01:38, 6 August 2015 (UTC)
Transclude Example?
[edit]Can anyone offer a transclude example? -thx Johnywhy (talk) 01:57, 29 April 2018 (UTC)
- http://test.foxway.org/wiki/PhpTags/Transclude Pastakhov (talk) 03:11, 30 April 2018 (UTC)
- thx. Seems the purpose of `transclude` is to output whatever you want to output to the host page. I guess transclude code would live in a template, correct?
- I'm looking for the opposite: a php way to pull in a rendered page.
- cheers Johnywhy (talk) 03:54, 30 April 2018 (UTC)
- Do you mean https://www.mediawiki.org/wiki/Manual:Parameters_to_index.php#render ? Pastakhov (talk) 05:33, 30 April 2018 (UTC)
- Or maybe https://www.mediawiki.org/wiki/API:Parsing_wikitext#parse Pastakhov (talk) 05:35, 30 April 2018 (UTC)
- thx, i'll be reading those! Johnywhy (talk) 06:00, 30 April 2018 (UTC)
Read Messages
[edit]It would be a very nice thing, to make it possible to read/import a message/page/article and be able to parse this.
Example:
$json=read('Mediakwiki:TextBasedDataInJsonFormat');
$array=json_decode($json,true);
foreach($array as $item){
// do very nice things