User Profile

Collapse

Profile Sidebar

Collapse
rienh
rienh
Last Activity: Nov 19 '10, 08:42 AM
Joined: Aug 30 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • rienh
    started a topic PHP Pagination and POST/SESSION variables problem
    in PHP

    PHP Pagination and POST/SESSION variables problem

    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...
    See more | Go to post

  • rienh
    replied to Last word of string UpperCase
    in PHP
    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;
    See more | Go to post
    Last edited by rienh; Sep 1 '10, 09:39 AM. Reason: type error

    Leave a comment:


  • rienh
    started a topic Last word of string UpperCase
    in PHP

    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
    ...
    See more | Go to post
    Last edited by rienh; Aug 30 '10, 02:10 PM. Reason: type error
No activity results to display
Show More
Working...