Welcome! Log In Create A New Profile

Advanced

PHP 7- String Manipulation

Posted by 77911997 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
PHP 7- String Manipulation
February 20, 2013 10:56PM
String Manipulation - Done. it was easy to understand, but i think i will need a cheat-sheet to remember all these functions especially because its not something you can use in your everyday coding.

I am looking forward to PHP 8 - create your own functions.
Re: PHP 7- String Manipulation
February 23, 2013 07:57AM
Done. Made sense.
avatar Re: PHP 7- String Manipulation
February 28, 2013 10:42AM
String Manipulation can be very handy but I often catch myself getting carried away with trying to do to much and then I end up with a bunch of rubbish text so I try to just do the necessary without adding to many flourishes.

smiling bouncing smiley I've always wanted to run a script on my site to check what browser people are using and if it's anything below IE9 to print out that they have 10sec to upgrade or their PC will explode smiling bouncing smiley

77911997, this should help you Cheat Sheet

____________________________________________Nazi Coder____________________________________________

I'm not antisocial, I'm just not user friendly

"It's not a bug; it's an undocumented feature!" ~ some unknown Microsoft developer
Re: PHP 7- String Manipulation
February 28, 2013 05:20PM
string manipulation section done.. thanks for the cheat sheet @Shado ill be saving that bad boy in my ass pocket.. got a couple myself cubicle looked like a graffiti wall lol..

time to get to functions.. booja..

Student number : 7803-010-2
Email and Gtalk for support : wilcovandeijl@gmail.com
avatar Re: PHP 7- String Manipulation
March 04, 2013 08:49PM
My pleasure wilco

____________________________________________Nazi Coder____________________________________________

I'm not antisocial, I'm just not user friendly

"It's not a bug; it's an undocumented feature!" ~ some unknown Microsoft developer
Re: PHP 7- String Manipulation
March 05, 2013 04:40AM
Had no trouble with section 7.
Thank you Shadow for the cheet sheat
Re: PHP 7- String Manipulation
March 05, 2013 10:53PM
String manipulation almost done.

Changing case, trimmimg, shuffling & finding positions, splitting & joining lines and escaping certain characters done.

Before moving on to functions, I'll definitely revisit this part to explore the === operator:

... just in case the character you're searching for is at position 0,
one must use the triple equals operator ( = = = ), which checks for a value
and also what type of value it is: integer, string, Boolean, etc.

Done for today!
avatar Re: PHP 7- String Manipulation
March 11, 2013 04:22AM
Found string functions very good, sure will use it often in the future, thanks for cheat sheet, will make them easier to use! The === is very insightful, but will need to read more about that operator.
Re: PHP 7- String Manipulation
March 13, 2013 10:51PM
Done and dusted

..&ru..
Re: PHP 7- String Manipulation
March 19, 2013 08:56AM
Managed to knock off chps 6 & 7 last weekend. I tried the findbrowser script on IE, FIREFOX, CHROME and it works fine with a few IF statements embedded. Arrays and string manipulation are very important part of programming, I have worked with them in other languages (COBOL, Fortran, Dbase,C..) in the past. Will be moving on 8,9,10 soon.
Re: PHP 7- String Manipulation
March 20, 2013 10:35AM
done. explode and implode similar to perl's split and join.
Re: PHP 7- String Manipulation
March 20, 2013 01:48PM
Quite interesting the Explode and Implode smiling smiley The find browser script was cool but didn't pick up my (Chrome) browser so edited the code and it did smiling smiley on to the next chapter.
avatar Re: PHP 7- String Manipulation
March 20, 2013 11:31PM
The ucwords() function in PHP is amazing.
I've written my own functions in other languages to handle this kind of string manipulation.
The trim() function in PHP is also very useful.
Users often add trailing white spaces after the text they input.
The string position function can also be very useful.
In the example given the PHP scripts gets the browser name, converts it to uppercase.
The strpos() function gets the position of the uppercase browser name.
The if statement will print the name of the browser that was found.
I've always wondered what the explode() function does.
I've seen code snippets where the explode() function is used to build a twitter feed.
The str_word_count() function could be very useful.
I suppose it could be used to see how many words a person can type per minute.
Re: PHP 7- String Manipulation
March 21, 2013 05:42PM
This was a nice and easy going section.
str_shuffle() is such a fun function.

I also particularly liked this bit of code :
Language: PHP
$agent = $_SERVER["HTTP_USER_AGENT"]; print $agent;

Implode() and explode() have such nice names.

The bit on escaping was interesting too.
avatar Re: PHP 7- String Manipulation
March 22, 2013 11:18PM
Very informative chapter.
I liked the browser script, and will stick to echo rather than print.
Re: PHP 7- String Manipulation
March 31, 2013 04:22PM
Done
Re: PHP 7- String Manipulation
April 01, 2013 10:18PM
I am using string built-in functions in order to validate some of the user inputs on the student registration form.
Sorry, only registered users may post in this forum.

Click here to login