Deletion of some text using PHP


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
13 views
I'll note that I'm still a novice to PHP.

For example, there is a link:

Link

How to remove?

 title="Title"
by | 13 views

4 Answers

0 like 0 dislike
With qJerry you can work with XML in PHP is as easy as jQuery in JavaScript with HTML.
\r
Here's the code:
q('Link')->removeAttr('title')->dump(); 
outputs:
<?xml version="1.0"?>\rLink
by
0 like 0 dislike
Something like that, not tested, but should work:
\r
str_replace('Link','Link',$Text);
by
0 like 0 dislike
Put the engine to work with the DOM as described above. Another alternative is to use JS, just not quite sure if it's appropriate in Your case (JS will work after the formation of the source).
by
0 like 0 dislike
People, and there is an html parser, it on habré used... There you can specify allowed tags and attributes. What is it called?
by
110,608 questions
257,186 answers
0 comments
26,923 users