Hi I have a function getHtml($head, $tail, $page) which takes from an HTML page everything that is surrounded by $head and $tail however i have some situations where in $head i have to put up multy lines for example if the HTML looks like this <b>here is the link</b> <span class=big>http//www.link.com</span> <b>here is the image</b> <span class=big>http://www.link.com/image.jpg</span> HTML: in the code above, if i want to take only image, i have to put in my $head the exact same thing as it appears on the HTML above, like this <b>here is the image</b> <span class=big> HTML: Including the NEW LINES and all the spaces and/or tabs so .. now .. how can i assign the above thing to my $head variable ? if i write something like $head = "<b>here is the image</b>\n \n <span class=big>" Code (markup): this simply doesn't work anybody knows a way of writing this kind of a thing ? how do i assign the above 3 lines to my variable keeping their structure ? Thanks!
if i'm following you correctly you just want to add a tab in there? if that's the case.. echo "<pre>"; echo "line one\n\tline two"; echo "</pre>"; PHP:
Just assign a variable instead of echoing it, in ansi's code. The \n character stands for a new line, and the \t for a vertical tab. $foo = "line one\n\tline two"; PHP: Btw, to actually SEE the new line in the browser, you have to use the <br /> tag. $foo = "line one<br />\n\tline two"; PHP: