[pmwiki-users] Markup/php question

Tom Cato Amundsen tca at gnu.org
Mon Jan 31 03:27:43 CST 2005


Hello. I'm writing some new markup to be used on my wiki. I know python
very well, but I'm having a little trouble with php:

function xlink_func($url, $text) { 
    return substr($url, 0, 3);
}
markup('xlink', 'inline', '/\\(:xlink ([^\s]*)(\s(.*?))?:\\)/',
 xlink_func('$1','$2'));

The substr function does nothing, it just returns the whole $url.
If I write a string, "abcde" instead of $url in xlink_func, then
substr does what I expect.

What am I doing wrong here?
-- 
Tom Cato Amundsen <tca at gnu.org>                 http://www.solfege.org/
GNU Solfege - free ear training    http://www.gnu.org/software/solfege/



More information about the pmwiki-users mailing list