grabek
Mar 29 2004, 03:06 AM
Hi there,
How can I extract a first letter of an entry and parse it through PHP? I doubt whether $temp=<$MTEntryBody words="1">; do_some_things_with_temp; works. Also, I feel reluctant to install any plugins (of existance which I am aware).
almuhajabah
Mar 29 2004, 03:11 AM
CODE
<$MTEntryBody trim_to="1"$>
grabek
Mar 29 2004, 03:20 AM
It was PHP problem. Fortunately it is MT that is interpreted first (that is a truism, actually) so all values that are held in MT variables can be parsed via PHP. So far I've figured out this snippet:
";
$letter=$temp[0];
echo $letter;
?>.png) no-repeat 0 0">
<$MTEntryBody$>
almuhajabah
Mar 29 2004, 03:28 AM
Yes, the MT tags are parsed when the page is created, and the PHP is parsed when the page is loaded in a browser. You asked for how to get the first letter of an entry using MT tags, so I gave you that. If you're looking for help on how to use PHP to manipulate the content generated by MT, a PHP forum might be a better place, since not everyone here knows PHP.
grabek
Mar 29 2004, 03:59 AM
Erm, yeah, my wrong, I didn't want to post rubbish on the forum. Sorry for the trouble; I simply forgot to add quotation mark.
Anyway, if someone's interested in the final effect it can be read about
here.