Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Any idea how to solve this?

    Hi i know php with mysql ... but i am not so great in this how i would want.

    I have problem... to example:

    i have:

    PHP Code:
     $string_array[2]="Peter is man."
    PHP Code:
      $string_array[1]="man"
    And i want echo $result ... Peter is. How to do that? :/ If u would know the soltion i would be very happy.

    Btw this looks like very nice forum.
    Last edited by Trki; 01-08-2012 at 06:38 PM.

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Your English isn't the best (guessing not your first language), but I THINK I know what you're trying to say. You have an array, and you want to echo $string_array[2] - $string_array[1]?
    PHP Code:
    echo trim(str_replace($string_array[1],'',$string_array[2])); // Will echo 'Peter is' 
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #3
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts
    no i am not i am from slovakia... and... thx for this function ... before i read your comment i was thinking... what i actually need to do... i need remove... man... or... remove... replace... or wait on replace is a function and i know it ... i tried it and it was worked well and dann i came here for delete this topic and i found here your comment. But thx i think i can remove the topic now ? or let it here?

  • #4
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    Quote Originally Posted by Trki View Post
    no i am not i am from slovakia... and... thx for this function ... before i read your comment i was thinking... what i actually need to do... i need remove... man... or... remove... replace... or wait on replace is a function and i know it ... i tried it and it was worked well and dann i came here for delete this topic and i found here your comment. But thx i think i can remove the topic now ? or let it here?
    Haha, I usually solve problems by saying them outloud - freaks people out in my house :P.

    Generally, topics aren't removed - they're set to resolved. Edit your first post, click 'go advanced' and set the topic to resolved in there .
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

  • #5
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BluePanther View Post
    Haha, I usually solve problems by saying them outloud - freaks people out in my house :P.

    Generally, topics aren't removed - they're set to resolved. Edit your first post, click 'go advanced' and set the topic to resolved in there .
    hh i can't say it becase i dont hear myself... music ...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •