Jump to content
Fórum Script Brasil
  • 0

[Resolvido] Acrescentar espaço em branco depois da palavra


Rodrigo Kx

Question

Bom glr, tenho um foreach, onde pego os dados dos checkbox e guardo na variavel. Mas pra gravar no banco, a variável deve conter espaço sempre depois da última palavra, exemplo:"00 12 " ou somente "12 ".

Aqui está o código que faz isso, mas não incrementa o espaço no final, porque?

$nrun = 0;
    $run = "";
    foreach ($_POST['run'] as $r) {
        $run = $run . $r . " ";
        $nrun++;
        echo "<span class='dados'>".$r."<br/></span>";
    }
echo $run;

Edited by Rodrigo Kx
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...