Getting This Error In PHP Scripts Please Any Help? - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Getting This Error In PHP Scripts Please Any Help? (569 Views)
| Getting This Error In PHP Scripts Please Any Help? by Premiumwriter(op): 2:39am On Apr 01, 2021 |
The line of the code giving me problem is this: $pad = ord($text{strlen($text) - 1}); The error I got is Fatal error: Array and string offset access syntax with curly braces is no longer supported in (then the directory of the file with the line code). Please any help on how I can fix this? Thanks |
| Re: Getting This Error In PHP Scripts Please Any Help? by stanliwise(m): 7:59am On Apr 01, 2021 |
Premiumwriter:Please explain what $text means. If $text is an array then do $text[] rather than $text{} |
| Re: Getting This Error In PHP Scripts Please Any Help? by Premiumwriter(op): 9:35am On Apr 02, 2021 |
stanliwise:I changed the {} to [] but the code stopped loading. i have attached a screenshot for you to see. the first screenshot is the original one while the second screenshot is the one i made the changes as you suggested and it stopped responding. line 167 fnep2smooth
|
| Re: Getting This Error In PHP Scripts Please Any Help? by stanliwise(m): 10:32pm On Apr 02, 2021 |
Premiumwriter:The problem here now is that your screenshot does not tell what type of data we are expecting $text to be, should it be array? string? integer? object? meanwhile ord by nature receives a character as an argument. so my conclusion would be this ord($text[strlen($text) - 1)]); The above should be the correct pattern |
Encountering This Error In Django: TypeError: 'module' Object Is Not Iterable • Who Can Decipher This Error For Me? • I Keep Getting This Error Message "Gradle Project Syn Failed... • 2 • 3 • 4
How To Upgrade Nairaland • The Best Microsoft's SQL. Server Course On Udemy • How To Find The Right Development Firm To Convert PSD To Shopify?