Skip to content
Advertisement

Tag: text

PHP Split XML based on multiple nodes

I honestly tried to find a solution for php, but a lot of threads sound similar, but are not applicable for me or are for completely different languages. I want to split an xml file based on nodes. Ideally multiple nodes, but of course one is enough and could be applied multiple times. e.g. I want to split this by

PHP not comparing “#”

I have a simple script where I enter some text on my search bar and PHP echo the first character from the text. My code: $data = strval($_GET[‘u’]); $ss = substr($data, 0,1); if ($ss == “@”)…

Text File to Array

I am trying to put my text file into an array.. my text file content is like this: anyone can help me to make the output looks like this: thanks in advance.. this is my code:- the problem is it outputs a multidimensional without array names.. and i am not familiar in multidimensional array.. Answer You can do something like

How to split text based on specific word

I have a text which contains the word “Article” many times for example: My text title Article 1 bla bla Article 2 bla bla … I want to split the text like this: Answer Instead of trying to find a split pattern, you should look for a matching pattern: It matches Article, followed by anything up to but not including

Short Text, PHP

I got this function: and if I use echo shorter($input, 11) it works ok, but if there are some white spaces in the input, otherwise for the input looking like: wwwwwwwwwww The function will change this into: … (3 dots). I wan’t it to be changed into something like this: www … Have you got any ideas how to rebuild

Write Post data to file with PHP

I need to post data using the code below, to php file that will save it in a text file. I just don’t know how to create the php file to receive the data below and save it in a text file. as simple as possible. Answer Simple as:

Advertisement