English 中文(简体)
为什么有空间特性引起混乱问题?
原标题:Why are space characters causing concatenation problems?
  • 时间:2024-05-04 01:37:41
  •  标签:
  • php
  • html
  • echo

我试图用购买力平价中的对应指令来重复一行超文本。 这里是:

echo <tr><td><input category=“check Box” name=”。 美元现值单位,“检查/研究;研究;/td><td><label> 美元现值单位单位, . </label></td></tr>

I set the name attribute of a checkbox to $currentTeam. When $currentTeam has a space character and I try to check if it s checked upon form submission, it doesn t register. When $currentTeam does not have a space character and I check the box, I m able to see if it s set using isset() upon form submission. This is strange because the same $currentTeam variable has no problem printing out just fine in the <label> for the checkbox. I m assuming it s because there something going on with the quotes and the space character.

我试图改变单一报价的用法,如两倍,但无uck。 是否有任何人的想法?

问题回答

当你在网页上以内容印刷时,你在<代码>上的空间是无法解释的。 但是,如果你将其用作姓名、id等财产,价值将保持不变,包括拖车空间。

当你将它作为内容输出时,例如贴标签文本,将多处空间作为单一空间,而单一空间很可能在你网页上无法说明。

例如:

        $currentTeam = "team1";
        $currentTeam2 = "          team2          ";

        echo  <tr><td><input type="checkbox" name="  . $currentTeam .  " checked/></td><td><label>  . $currentTeam .  </label></td></tr> ;
        echo  <tr><td><input type="checkbox" name="  . $currentTeam2 .  " checked/></td><td><label>  . $currentTeam2 .  </label></td></tr> ;

你们在你的网页上看到了空间/空间,但如果你看一看这些内容,标签有1个空间(多片变成单一),空间仍然以检查箱名称。

“entergraph

当我派出时,小组2名代表的席位将保持不变。 为什么没有登记:

“entergraph

为了确定这一点,你首先想在你网页上使用这一数值。

        $currentTeam = "team1";
        $currentTeam2 = trim("          team2          ");

        echo  <tr><td><input type="checkbox" name="  . $currentTeam .  " checked/></td><td><label>  . $currentTeam .  </label></td></tr> ;
        echo  <tr><td><input type="checkbox" name="  . $currentTeam2 .  " checked/></td><td><label>  . $currentTeam2 .  </label></td></tr> ;

“entergraph

2个小组的名称上没有更多的空间:

https://i.sstatic.net/HBxw0fOy.png” rel=“nofollow noreferer”>“entergraph





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签