by Alex Vanden Bosch.
It looks like you're onto a winner there; I followed the 'hello world' tutorial and it works perfectly! I think I owe you about a month of my life!
One small question though. This is the hello word code:
<?php
class filter_helloworld extends moodle_text_filter {
public function filter($text, array $options = array()) {
return str_replace('world', 'hello world!', $text);
}
}
?>
So it replaces the string 'world' with 'hello world!', but I have a list of about 400 words to change. How would that go in the coding? Like this?
return str_replace('colour', 'color', $text);
return str_replace('centre', 'center', $text);
return str_replace('metre', 'meter', $text);