I'am using Adam's pagination script from: http://www.developphp. com/view_lesson.php ?v=289 And I adjusted the code just a little, so it fitted my needs.
Now I bumb into a problem, and I can't figure it out, how to let the script doing its job right.
The adjusted pagination script pulls a list of links, from my database from a certain category.
The pagination script is called from a link on another page, so that other categories...
User Profile
Collapse
-
PHP Pagination and POST/SESSION variables problem
-
Thanks to the solution of NoDog for providing me the solution, and solving my problem. The following code, did do the trick for me.
Code:$var = 'volkswagen-golf-gti'; $regexp = array( '/-/' => ' ', '/.*/e' => 'ucwords("$0")', '/\b\S+$/e' => 'strtoupper("$0")' ); $var2 = preg_replace(array_keys($regexp), $regexp, $var); echo $var2;
-
Last word of string UpperCase
Hello all, I try to accomplish the following.
I have a string like: “volkswage n-golf-gti” **
And I want it to change the string into:
“Volkswage n Golf GTI” (last part completely uppercase)
But I have some difficulties understanding preg_replace.
Right now I have the following code:
Code:<?php $string = 'volkswagen-golf-gti'; $string2 = ucwords(str_replace('-', ' ', $string)); $string2
No activity results to display
Show More
Leave a comment: