Miscellaneous Functions Library: eval

Source: Internet
Author: User
Keywords PHP Chinese function manual miscellaneous function library
Tags aliyun code find function function library functions html http

Eval

(unknown)

Eval---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Find the value of the string PHP code

Syntax: Mixed eval (string code_str)

Description:

Eval () Code_str the value of the PHP code with the string parameter, which can be used to store the code in the database text field for subsequent programs.

When using eval (), some elements must remember that the arguments passed to the function must be valid PHP code, including the semicolon (;) of the program termination description, so that no error occurs and the appropriate escape from the parameter code_str.

The value of the variable given in eval () will retain the values in later programs.

The description of return will immediately terminate the evaluation of the string, in PHP4, you can return a value by using returns, which will be the result of Eval (), and it will not return anything in PHP3.

Example:

<?php

$string = ' Cup ';

$name = ' coffee ';

$str = ' is a $string with my $name in it.<br> ';

Echo $str; Eval ("\ $str = \" $str \; ");

Echo $str;

?>

The example above will show:

This are $string with my $name in it.

This is the cup with my coffee in it.

Related Article

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.