PHP spelling String Consult

Source: Internet
Author: User
Each time you spell a string, you feel a big head. Because there's no such bad habit.


Changing an old code
Refer to a JS method, as follows
Delete


Now to the top of the deletion of the wording, put to the bottom of the deletion above, do not know how to spell
echo "$intserial". $value [' Realname ']."". $value [' Mobile '].". $arrgender [$value [' Gender ']]."". $value [' IDNumber ']." ". $value [' Passportnu ']."Delete";

--------------------------------------------------------------------------------------------------------------
It's not right to write a few.
Error One:
echo "$intserial". $value [' Realname ']."". $value [' Mobile '].". $arrgender [$value [' Gender ']]."". $value [' IDNumber ']." ". $value [' Passportnu ']."Delete";


Reply to discussion (solution)

What kind of HTML do you ultimately need?
This is the way to get things done.

Your href= "Javascript:confirmdelete" (' delgroup.asp?gid=14 ', ' Group once deleted, the data will not be recoverable. Are you sure you want to delete this record? ');"
unclear meaning

1. Double and single quotes cannot be nested, and if nested, the middle part is escaped.
2. Single and double quotation marks can be used interchangeably.
3. With more quotes, you can use the Heredoc syntax
4. When stitching strings more, you can only stitch one line at a time.
$str. = ';
$str. = "";

Based on these principles, it is also easy to stitch strings:
Stitching 1:

 
  1,        ' realname ' = ' ' name ',        ' mobile ' = ' 13590909090 ',        ' gender ' and ' 1 ',        ' idnumber ' = ' idnum ' ,        ' passportnu ' = ' passport ',    );    $intserial = ' Ang? ';    echo "        $intserial        ". $value [' Realname '].        $value [' Mobile ']. "" . $value [' Gender ']. "        ". $value [' IDNumber ']. " " . $value [' Passportnu ']. "        Delete        ";


Stitching 2:
$str  = ""; $str. = "$intserial"; $str. = "". $value [' Realname ']. ""; $str. = "". $value [' Mobile ']. "" . $value [' Gender ']. ""; $str. = "". $value [' IDNumber ']. " " . $value [' Passportnu ']. ""; $str. =  "Delete"; $str. = ""; Echo $str;


The second method only splicing a small part at a time, the probability of splicing error is lower.

If you are HTML mixed with PHP, then you can only use the PHP echo variable, the rest of the parts with HTML code.

Thank you, two seniors.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.