Posted: Thu Oct 05, 2006 7:24 pm
I added a piece that will chop the title at the nearest whole word if the title exceeds $maxlength.. so you don't end up with half a word in a title.
IE:
title: "some long url with words chopped in half"
set to false: some-long-url-with-words-cho.html
set to true: some-long-url-with-words.html
[edit]
I used this code to do this:
If there is a function that will pop the last element of an array off and return the array minus that element, let me know. array_pop() returns only the last element, so i had to throw an array_diff() in there.
IE:
title: "some long url with words chopped in half"
set to false: some-long-url-with-words-cho.html
set to true: some-long-url-with-words.html
[edit]
I used this code to do this:
Code: Select all
$text = explode('-',$text);
$text = implode('-',array_diff($text,array(array_pop($text))));