string bearbeiten

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • string bearbeiten

    hallo leute!
    folgender code schnipsel:
    PHP Code:
    for($i=0;$i<$sp_anzahl;$i++){
      if (isset(
    $values_enum[$i])) {
        
    $test[$i]="(".$values_enum[$i].")";
        echo 
    $test[$i]."<br>";

    ausgabe lautet zb.: (g,g,g)
    nun möchte ich aber aus (g,g,g) diesen string machen ('g','g','g')
    bekomme das einfach nicht hin #
    kann mir da jemand ein wenig helfen
    danke

  • #2
    quick&dirty

    PHP Code:
    $string '(g,g,g)';
    $string str_replace(array('(',')'), array('',''), $string);
    $string '('.implode("','"explode(','$string).')';
    echo 
    $string
    *untested*
    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


    Comment


    • #3
      re

      danke für die antwort funkt wunderbar

      Comment


      • #4
        würde das auch nicht so gehen?:
        PHP Code:
        $str "(g,g,g)";
        $str str_replace("g""'g'"$str); 
        Aber wenn cih mir das grade so überlege, ist das auch schwachsinnig
        Last edited by davidovich; 07-09-2004, 11:53.

        Forumregeln!

        Gute PHP-(tutorial-)Seiten

        Comment


        • #5
          das würde durchaus auch funktionieren .... aber .... ausgabe lautet zb
          INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


          Comment

          Working...
          X