I am copying over some HTML tags, echo'ing them into a PHP file
I run into problems because some of the image HTML tags have quotes, or the double slashes in a url and that causes PHP to mess up. Is there a way to be able to read these in?
For example:
file1 has contents:
my command is:Code:<a href><img src='http://example.com/image.gif'></a>"
I think it's also possible to get http tags in a double quote as well, which throws off my echo command as well. This is a shell scripting and PHP problem.Code:echo "`grep \"href\" file1`">> file.php
file1 has contents (Difference is the double quotes around url instead of single quotes):
my command is:Code:<a href><img src="http://example.com/image.gif"></a>"
Any ideas?Code:echo "`grep \"href\" file1`">> file.php
Maybe one way would be to use something different than cat and only pull out the image.gif url. Problem is I don't know how to pull that url only out of the tag. Grep will pull the whole line as well. Sed I don't know how to use.


LinkBack URL
About LinkBacks
Reply With Quote
icon below! (this is even better than "liking" a post)

