PDA

View Full Version : سوال: تبدیل فرم html به رشته



reza_first1
دوشنبه 13 دی 1389, 11:30 صبح
سلام دوستان یک سوال : من داخل یک صفحه یک صفحه html رو لود می کنم و این فرم داخل یک متغیر هست حالا من می خوام این فرم رو به صورت یک رشته داخل یک متغیر دیگه داشته باشم ممنون می شم کمک کنید.
برای واضح تر شدن مسله مثلا من الان داخل متغیر form$ یک صفحه html دارم حالا من محتویات form$ رو به صورت رشته لازم دارم .

Mr.Moghadam
دوشنبه 13 دی 1389, 12:35 عصر
میشه منظورتون رو دقیقتر بگین ؟

یعنی میخوای صفحه html ت با تگهاش چاپ بشه؟ اینجوری؟


<form action="" name="myform" >
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="right">First Name</td>
<td><input type="text" name="FirstName"></td>
</tr>

اینو میخوای چاپ کنی؟

reza_first1
دوشنبه 13 دی 1389, 13:23 عصر
آره می خوام همین جوری داخل یک متغیر داشته باشم.

mohsen24000
دوشنبه 13 دی 1389, 13:50 عصر
<?php
ob_start();
HTML here
$html = ob_get_contents();
ob_end_clean();
?>

maysam.m
دوشنبه 13 دی 1389, 16:13 عصر
<?php
$homepage = file_get_contents('http://www.urlform.com/');
echo $homepage;
?>
file_get_contents (http://php.net/manual/en/function.file-get-contents.php)

Vahid Faraji
دوشنبه 13 دی 1389, 17:34 عصر
The file_get_contents() reads a file into a string.

This function is the preferred way to read the contents of a file into a string. Because it will use memory mapping techniques, if this is supported by the server, to enhance performance.