如何在PHP中打印句子的每个单词?

时间:2016-11-27 04:56:05

标签: php laravel

假设选择10tag,但当我单独显示此标签时,我该怎么办?

how can i print all tag individual as like C, C#, Java , PHP, Python, .net 这是我的照片的链接 https://i.stack.imgur.com/qqN2Q.png

1 个答案:

答案 0 :(得分:0)

因为你的问题和你的问题的标题对我来说并不清楚。
如果你想从字符串中取出所有单词,那么这里是你的代码

    final EditText NAME = (EditText) findViewById(R.id.editText);
    final EditText ADDRESS = (EditText) findViewById(R.id.editText6);
    final EditText EMAIL = (EditText) findViewById(R.id.editText2);
    final EditText PHONE = (EditText) findViewById(R.id.editText4);
    final EditText MOBILE = (EditText) findViewById(R.id.editText5);
    final EditText QDESCRIPTION = (EditText) findViewById(R.id.editText3);
    final EditText JDESCRIPTION = (EditText) findViewById(R.id.editText7);
    final Button Donebutton = (Button) findViewById(R.id.button2);
    Font application = (Font) getApplication();
    application.setTypeface(NAME);
    application.setTypeface(ADDRESS);
    application.setTypeface(EMAIL);
    application.setTypeface(PHONE);
    application.setTypeface(MOBILE);
    application.setTypeface(QDESCRIPTION);
    application.setTypeface(JDESCRIPTION);
     Donebutton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {


            final Intent aa = new Intent(MainActivity.this,  JobTrackingActivity.class);
            aa.putExtra("NAME", NAME.getText().toString());
            aa.putExtra("ADDRESS", ADDRESS.getText().toString());
            aa.putExtra("EMAIL", EMAIL.getText().toString());
            aa.putExtra("PHONE", PHONE.getText().toString());
            aa.putExtra("MOBILE", MOBILE.getText().toString());
            aa.putExtra("QUOTEDESCRIPTION", QDESCRIPTION.getText().toString());
            aa.putExtra("JOBDESCRIPTION", JDESCRIPTION.getText().toString());
            startActivity(aa);
        }
    });
}

输出:

<?php

    $sentence = "my name is xyz";
    $store = explode(" ",$sentence); // this will output an array of words
    print_r($store);

?>

如果您想将这些单词显示为您的图片,那么这可能对您有所帮助(虽然我不会在这里使用任何锚标记,但我只是在显示你的方式,你应该进一步设计它看起来像你的图片):

&#13;
&#13;
Array ( [0] => my
        [1] => name
        [2] => is 
        [3] => xyz
      ) 
&#13;
	body {
	 background:pink;	
	}

	ul{
	   
	}
	ul li {
	list-style: none;
	display: inline-block;
	background: green;
	padding: 10px;
	width: 120px;
	text-align: center;
	color:#fff;
	}
	ul li:hover{
		background:#fff;
		color:#000;
	}
	nav{
	    width: 900px;
		margin: 0 auto;

	}
	
&#13;
&#13;
&#13;