开发者

how to get particular value by php if conditon string

开发者 https://www.devze.com 2023-02-08 11:01 出处:网络
An easy question to ask hope not stupid. I am doing a Search engine process. i have a search engine box. if i enter a particular word in that box, that word must come up below the box with some descri

An easy question to ask hope not stupid. I am doing a Search engine process. i have a search engine box. if i enter a particular word in that box, that word must come up below the box with some description.

i used this code:

 $TStringPosStart =strpos($ConvertedResult, 'class="search_box_input" value="') + 32;
    $TConvertedResult = substr($ConvertedResult, $TStringPosStart, $TotalLength);
    $TStringPosEnd   = strpos($TConvertedResult, '"') + $TStringPosStart;

    $value=="software";
    if($value=="software")
{
    echo "The software engineer job encompasses a fairly wide range of responsibilities.Smaller appl开发者_运维百科ications and systems may employe just a few software engineers to manage the full lifecycle software development process! ";
    }

but it comes to the top of the page. instead of that, i want this below the box. how should i do this? is there any way to obtain?


Just an idea, but are you echoing the code in the right place? From what you mention "it comes to the top of the page" means to me that you're echoing it out at the wrong place in the body.

You can always do something like:

  <? if($value=="software") $display_comment = "The software engineeer..."; ?>

Then in your HTML, just make you sure put this in the right place:

<form id="something">
<input type="text" />
<?= $display_comment ?>

Just a solution to test.


Try echo '<div id="box"> The software.... </div>'; and then you position div#box the way you want, if I understand the questioon correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消