带有html标签的echo函数

I want to create tags using echo function but I'm stuck here; I dont know how to make it through.

This is what I want to do:

echo "<img src=$row['one'] style="width:100px"/>" ;

(Note: $row['one'] is a variable of php script and that contains the path of the image), but it throws me these error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\im.php on line 13

I want these statement to execute in php and I tried this way too:

echo '<img src=$row['one'] styel="width:100px" />';

These time I get the error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\im.php on line 13

I know where the error is. The error is most probably here

'<img src=$row[' //here's the error, right?

I worked on c and quite some other languages. I know that in c, to use double quotes in the printf we follow up some syntax but I dont know what to do in php.

You need to escape the ":

echo "<img src=\"{$row['one']}\" style=\"width:100px\" />";

or you use single quotes and do this:

echo '<img src="', $row['one'], '" style="width:100px" />';

There is never a need to concatenate in order to echo. You can always just use ,. The php manual explains the differences between ' and " in the chapter on strings.

As a goodie, because you mentioned printf, this works in php, too:

printf('<img src="%s" style="width:100px"/>', $row['one']);

You need to concatenate the string.

 echo "<img src='".$row['one']."' style='width:100px'/>" ;

You are also mixing your quotes up,

// Bad: echo "<img... style="width:100px"/>";

You have to be mindful of which quotes you are using to create the string. You are using the double quotations to both create the string, and define your width. You can fix this by escaping the quotes used to write the width, ex: \"width:100px\", or you can use single quotes like in my example.

echo "<img src='" . $row['one'] . "' style='width:100px'/>" ;
echo "<img src=$row['one'] style="width:100px"/>" ;

You cannot have (unescaped) double quotes inside double quotes. It should be:

echo "<img src='{$row['one']}' style='width:100px'/>" ;

Some notes: HTML attributes can be quoted using either single or double quotes. Double quotes expand variables (single quotes don't). Putting variable names in {} helps when using arrays.

echo "<img src=\"{$row[one]}\" style=\"width:100px\" />";

I want to create tags using echo function

That's wrong desire.
Do not use echo to create tags. Tags belongs to HTML, not to PHP.
So, just write usual HTML, bereaking it for PHP only when needed.

<img src="<?=$row['one']?>" style="width:100px"/>